/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('mpserverless', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddCorsDomainRequest {
  domain?: string(name='Domain', example='*.example.com:*'),
  spaceId?: string(name='SpaceId', example='mp-0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model AddCorsDomainResponseBody = {
  domainId?: string(name='DomainId', example='97e3ff58-01e4-****-b975-1805fec34d77'),
  requestId?: string(name='RequestId', example='74374923-6536-46EB-8639-409384EAE980'),
}

model AddCorsDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddCorsDomainResponseBody(name='body'),
}

async function addCorsDomainWithOptions(request: AddCorsDomainRequest, runtime: Util.RuntimeOptions): AddCorsDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domain)) {
    body['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddCorsDomain',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addCorsDomain(request: AddCorsDomainRequest): AddCorsDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addCorsDomainWithOptions(request, runtime);
}

model AddDingtalkOpenPlatformConfigRequest {
  appId?: string(name='AppId', example='dingoa7pqicyk3x9t*****'),
  appSecret?: string(name='AppSecret', example='1r0ElNPFqLI6qgY08*******************************9TIK3RN_5fk9SEMO'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model AddDingtalkOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='44DF7A95-603F-4651-9298-BE1850BEB53F'),
}

model AddDingtalkOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddDingtalkOpenPlatformConfigResponseBody(name='body'),
}

async function addDingtalkOpenPlatformConfigWithOptions(request: AddDingtalkOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): AddDingtalkOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appSecret)) {
    body['AppSecret'] = request.appSecret;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddDingtalkOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addDingtalkOpenPlatformConfig(request: AddDingtalkOpenPlatformConfigRequest): AddDingtalkOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDingtalkOpenPlatformConfigWithOptions(request, runtime);
}

model AttachWebHostingCertificateRequest {
  certName?: string(name='CertName', example='testCert'),
  certType?: string(name='CertType', example='upload'),
  domain?: string(name='Domain', example='www.example.com'),
  privateKey?: string(name='PrivateKey', example='-----BEGIN RSA PRIVATE KEY----- ...... -----END RSA PRIVATE KEY-----'),
  serverCertificate?: string(name='ServerCertificate', example='-----BEGIN CERTIFICATE-----  ...... -----END CERTIFICATE-----'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model AttachWebHostingCertificateResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='CEF9831B-A6D2-4485-9CAD-1B8FBC8B****'),
}

model AttachWebHostingCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachWebHostingCertificateResponseBody(name='body'),
}

async function attachWebHostingCertificateWithOptions(request: AttachWebHostingCertificateRequest, runtime: Util.RuntimeOptions): AttachWebHostingCertificateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.certName)) {
    body['CertName'] = request.certName;
  }
  if (!Util.isUnset(request.certType)) {
    body['CertType'] = request.certType;
  }
  if (!Util.isUnset(request.domain)) {
    body['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.privateKey)) {
    body['PrivateKey'] = request.privateKey;
  }
  if (!Util.isUnset(request.serverCertificate)) {
    body['ServerCertificate'] = request.serverCertificate;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AttachWebHostingCertificate',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function attachWebHostingCertificate(request: AttachWebHostingCertificateRequest): AttachWebHostingCertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachWebHostingCertificateWithOptions(request, runtime);
}

model BatchDeleteWebHostingFilesRequest {
  filePaths?: [ string ](name='FilePaths', example='/static/test.png'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model BatchDeleteWebHostingFilesResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model BatchDeleteWebHostingFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDeleteWebHostingFilesResponseBody(name='body'),
}

async function batchDeleteWebHostingFilesWithOptions(request: BatchDeleteWebHostingFilesRequest, runtime: Util.RuntimeOptions): BatchDeleteWebHostingFilesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.filePaths)) {
    body['FilePaths'] = request.filePaths;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchDeleteWebHostingFiles',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchDeleteWebHostingFiles(request: BatchDeleteWebHostingFilesRequest): BatchDeleteWebHostingFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDeleteWebHostingFilesWithOptions(request, runtime);
}

model BindWebHostingCustomDomainRequest {
  customDomain?: string(name='CustomDomain', example='www.example.com'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model BindWebHostingCustomDomainResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='CEF9831B-A6D2-4485-9CAD-1B8FBC8BC6F7'),
}

model BindWebHostingCustomDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindWebHostingCustomDomainResponseBody(name='body'),
}

async function bindWebHostingCustomDomainWithOptions(request: BindWebHostingCustomDomainRequest, runtime: Util.RuntimeOptions): BindWebHostingCustomDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.customDomain)) {
    body['CustomDomain'] = request.customDomain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BindWebHostingCustomDomain',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindWebHostingCustomDomain(request: BindWebHostingCustomDomainRequest): BindWebHostingCustomDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindWebHostingCustomDomainWithOptions(request, runtime);
}

model CheckMpServerlessRoleExistsRequest {
  roleName?: string(name='RoleName', example='AliyunServiceRoleForMPServerless'),
}

model CheckMpServerlessRoleExistsResponseBody = {
  exists?: boolean(name='Exists', example='true'),
  requestId?: string(name='RequestId', example='F340DF8D-7125-49B7-AC48-7F5C8DB382CB'),
}

model CheckMpServerlessRoleExistsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckMpServerlessRoleExistsResponseBody(name='body'),
}

async function checkMpServerlessRoleExistsWithOptions(request: CheckMpServerlessRoleExistsRequest, runtime: Util.RuntimeOptions): CheckMpServerlessRoleExistsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.roleName)) {
    query['RoleName'] = request.roleName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckMpServerlessRoleExists',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkMpServerlessRoleExists(request: CheckMpServerlessRoleExistsRequest): CheckMpServerlessRoleExistsResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkMpServerlessRoleExistsWithOptions(request, runtime);
}

model CreateDBExportTaskRequest {
  collection?: string(name='Collection', example='article'),
  fields?: string(name='Fields', example='name,content'),
  fileType?: string(name='FileType', example='CSV'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model CreateDBExportTaskResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  taskId?: string(name='TaskId', example='0150006d-ab93-4920-a63e-c011dea1e089'),
}

model CreateDBExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBExportTaskResponseBody(name='body'),
}

async function createDBExportTaskWithOptions(request: CreateDBExportTaskRequest, runtime: Util.RuntimeOptions): CreateDBExportTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.collection)) {
    body['Collection'] = request.collection;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.fileType)) {
    body['FileType'] = request.fileType;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBExportTask',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDBExportTask(request: CreateDBExportTaskRequest): CreateDBExportTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBExportTaskWithOptions(request, runtime);
}

model CreateDBImportTaskRequest {
  collection?: string(name='Collection', example='test'),
  fileType?: string(name='FileType', example='CSV'),
  mode?: string(name='Mode', example='UPSERT'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model CreateDBImportTaskResponseBody = {
  accessKeyId?: string(name='AccessKeyId', example='LTAIupaslTlU*****'),
  expireTime?: string(name='ExpireTime', example='2020-07-20T05:32:03Z'),
  fileKey?: string(name='FileKey', example='mongo/import/0e16bb12-14af-4635-b24c-5ac1a9*****/20200720130203_973820af-966d-42ec-9fab-17dfe4a******.csv'),
  host?: string(name='Host', example='https://mps-zjk-share.oss-cn-zhangjiakou.aliyuncs.com'),
  policy?: string(name='Policy', example='eyJleHBpcmF0aW9uIjjoiMjAyMC0wNy0yMFQwNTozMjowMy40NDVaIiwiY29uZGl0aW9ucyI*****Y29udGVudC1sZW5ndoiMjAyMC=='),
  requestId?: string(name='RequestId', example='692DCFEF-46DD-4EBB-B1DB-338E687DC260'),
  signature?: string(name='Signature', example='*****luWDvbmhqwwy9pm/Mso++pk='),
  taskId?: string(name='TaskId', example='973820af-966d-42ec-9fab-17dfe4a*****'),
}

model CreateDBImportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBImportTaskResponseBody(name='body'),
}

async function createDBImportTaskWithOptions(request: CreateDBImportTaskRequest, runtime: Util.RuntimeOptions): CreateDBImportTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.collection)) {
    body['Collection'] = request.collection;
  }
  if (!Util.isUnset(request.fileType)) {
    body['FileType'] = request.fileType;
  }
  if (!Util.isUnset(request.mode)) {
    body['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBImportTask',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDBImportTask(request: CreateDBImportTaskRequest): CreateDBImportTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBImportTaskWithOptions(request, runtime);
}

model CreateDBRestoreTaskRequest {
  backupId?: string(name='BackupId', example='20201118114602_6bd7c996-f620-4026-ae24-418eddf78671'),
  newCollections?: string(name='NewCollections', example='newColl1,newColl2'),
  originCollections?: string(name='OriginCollections', example='coll1,coll2'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model CreateDBRestoreTaskResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  taskId?: string(name='TaskId', example='0150006d-ab93-4920-a63e-c011dea1e089'),
}

model CreateDBRestoreTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBRestoreTaskResponseBody(name='body'),
}

async function createDBRestoreTaskWithOptions(request: CreateDBRestoreTaskRequest, runtime: Util.RuntimeOptions): CreateDBRestoreTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.backupId)) {
    body['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.newCollections)) {
    body['NewCollections'] = request.newCollections;
  }
  if (!Util.isUnset(request.originCollections)) {
    body['OriginCollections'] = request.originCollections;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBRestoreTask',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDBRestoreTask(request: CreateDBRestoreTaskRequest): CreateDBRestoreTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBRestoreTaskWithOptions(request, runtime);
}

model CreateFunctionRequest {
  desc?: string(name='Desc'),
  memory?: int32(name='Memory', example='512'),
  name?: string(name='Name', example='demoFunction'),
  runtime?: string(name='Runtime', example='nodejs12'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-4a52-b4ff-xxxxx'),
  timeout?: int32(name='Timeout', example='5'),
}

model CreateFunctionResponseBody = {
  createdAt?: string(name='CreatedAt', example='2021-11-18T08:02:33.954Z'),
  desc?: string(name='Desc'),
  modifiedAt?: string(name='ModifiedAt', example='021-11-18T08:02:33.954Z'),
  name?: string(name='Name', example='demoFunction'),
  requestId?: string(name='RequestId', example='E63E7F4F-8538-5B0E-8712-78F92B6DCB9C'),
  spec?: {
    instanceConcurrency?: string(name='InstanceConcurrency', example='1'),
    memory?: string(name='Memory', example='512 MB'),
    runtime?: string(name='Runtime', example='Node.js 12'),
    timeout?: string(name='Timeout', example='5s'),
  }(name='Spec'),
}

model CreateFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFunctionResponseBody(name='body'),
}

async function createFunctionWithOptions(request: CreateFunctionRequest, runtime: Util.RuntimeOptions): CreateFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.memory)) {
    body['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.runtime)) {
    body['Runtime'] = request.runtime;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.timeout)) {
    body['Timeout'] = request.timeout;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createFunction(request: CreateFunctionRequest): CreateFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFunctionWithOptions(request, runtime);
}

model CreateFunctionDeploymentRequest {
  name?: string(name='Name', example='demoFunction'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-8514-xxxx'),
}

model CreateFunctionDeploymentResponseBody = {
  deploymentId?: string(name='DeploymentId', example='dep-5e49fd471c9d4451c33bdd06'),
  requestId?: string(name='RequestId', example='9D653EC3-8F53-4307-9B1C-52F5922384A6'),
  uploadSignedUrl?: string(name='UploadSignedUrl', example='http://bucket.oss-cn-shanghai.aliyuncs.com/afc0e1c9d446fxxxxx-v2.zip?OSSAccessKeyId=LTAIKCq5x****kK6&Expires=1561425220&Signature=xEuiAgUMShQ4v8fYIl3FM8Jp3MA%3D'),
}

model CreateFunctionDeploymentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFunctionDeploymentResponseBody(name='body'),
}

async function createFunctionDeploymentWithOptions(request: CreateFunctionDeploymentRequest, runtime: Util.RuntimeOptions): CreateFunctionDeploymentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFunctionDeployment',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createFunctionDeployment(request: CreateFunctionDeploymentRequest): CreateFunctionDeploymentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFunctionDeploymentWithOptions(request, runtime);
}

model CreateSpaceRequest {
  desc?: string(name='Desc', example='description'),
  name?: string(name='Name', example='space1'),
  workspaceId?: long(name='WorkspaceId', example='211975XXXX'),
}

model CreateSpaceResponseBody = {
  requestId?: string(name='RequestId', example='C44BB160-2F2D-5E34-BC08-B8C8B6D7702F'),
  spaceId?: string(name='SpaceId', example='fd46b91a-4591-49b6-abcd-59e9733*****'),
}

model CreateSpaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSpaceResponseBody(name='body'),
}

async function createSpaceWithOptions(request: CreateSpaceRequest, runtime: Util.RuntimeOptions): CreateSpaceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSpace',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSpace(request: CreateSpaceRequest): CreateSpaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSpaceWithOptions(request, runtime);
}

model CreateSpaceWithOrderRequest {
  desc?: string(name='Desc'),
  name?: string(name='Name', example='test'),
  packageVersion?: string(name='PackageVersion', example='professional'),
  period?: int32(name='Period', example='1'),
  subscriptionType?: string(name='SubscriptionType', example='Subscription'),
  useCoupon?: boolean(name='UseCoupon', example='true'),
}

model CreateSpaceWithOrderResponseBody = {
  instanceId?: string(name='InstanceId', example='emas_EmasServerlessPost_public_cn-n8m2y7l****'),
  orderId?: string(name='OrderId', example='222082414200***'),
  requestId?: string(name='RequestId', example='C71E8AEA-D1C3-****-956F-C261B7A43E92'),
  spaceId?: string(name='SpaceId', example='mp-1140a548-****-44ac-8bfb-a21c073f0d1a'),
}

model CreateSpaceWithOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSpaceWithOrderResponseBody(name='body'),
}

async function createSpaceWithOrderWithOptions(request: CreateSpaceWithOrderRequest, runtime: Util.RuntimeOptions): CreateSpaceWithOrderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.packageVersion)) {
    body['PackageVersion'] = request.packageVersion;
  }
  if (!Util.isUnset(request.period)) {
    body['Period'] = request.period;
  }
  if (!Util.isUnset(request.subscriptionType)) {
    body['SubscriptionType'] = request.subscriptionType;
  }
  if (!Util.isUnset(request.useCoupon)) {
    body['UseCoupon'] = request.useCoupon;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSpaceWithOrder',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSpaceWithOrder(request: CreateSpaceWithOrderRequest): CreateSpaceWithOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSpaceWithOrderWithOptions(request, runtime);
}

model DeleteAntOpenPlatformConfigRequest {
  appId?: string(name='AppId', example='201909116717****'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DeleteAntOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='2540E86F-2CD4-44AC-A7AB-59CAF40C225D'),
}

model DeleteAntOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAntOpenPlatformConfigResponseBody(name='body'),
}

async function deleteAntOpenPlatformConfigWithOptions(request: DeleteAntOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): DeleteAntOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAntOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAntOpenPlatformConfig(request: DeleteAntOpenPlatformConfigRequest): DeleteAntOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAntOpenPlatformConfigWithOptions(request, runtime);
}

model DeleteCorsDomainRequest {
  domainId?: string(name='DomainId', example='97e3ff58-01e4-****-b975-1805fec34d77'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DeleteCorsDomainResponseBody = {
  requestId?: string(name='RequestId', example='091A8BC0-8A73-4035-9441-922BF969631D'),
}

model DeleteCorsDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCorsDomainResponseBody(name='body'),
}

async function deleteCorsDomainWithOptions(request: DeleteCorsDomainRequest, runtime: Util.RuntimeOptions): DeleteCorsDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domainId)) {
    body['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCorsDomain',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCorsDomain(request: DeleteCorsDomainRequest): DeleteCorsDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCorsDomainWithOptions(request, runtime);
}

model DeleteDBCollectionRequest {
  body?: string(name='Body', example='{"command": "drop", "collection": "table1"}'),
  spaceId?: string(name='SpaceId', example='92e26ea9-6450-4b40-9c20-xxxx'),
}

model DeleteDBCollectionResponseBody = {
  requestId?: string(name='RequestId', example='20C1EDFE-6355-4344-B20A-A7A5A1581026'),
}

model DeleteDBCollectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBCollectionResponseBody(name='body'),
}

async function deleteDBCollectionWithOptions(request: DeleteDBCollectionRequest, runtime: Util.RuntimeOptions): DeleteDBCollectionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.body)) {
    body['Body'] = request.body;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBCollection',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDBCollection(request: DeleteDBCollectionRequest): DeleteDBCollectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBCollectionWithOptions(request, runtime);
}

model DeleteDingtalkOpenPlatformConfigRequest {
  appId?: string(name='AppId', example='dingoa7pqicyk3x9t*****'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DeleteDingtalkOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model DeleteDingtalkOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDingtalkOpenPlatformConfigResponseBody(name='body'),
}

async function deleteDingtalkOpenPlatformConfigWithOptions(request: DeleteDingtalkOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): DeleteDingtalkOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDingtalkOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDingtalkOpenPlatformConfig(request: DeleteDingtalkOpenPlatformConfigRequest): DeleteDingtalkOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDingtalkOpenPlatformConfigWithOptions(request, runtime);
}

model DeleteFileRequest {
  id?: string(name='Id', example='c568f23d-a46f-4866-****-142e5eb3e174'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DeleteFileResponseBody = {
  requestId?: string(name='RequestId', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model DeleteFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFileResponseBody(name='body'),
}

async function deleteFileWithOptions(request: DeleteFileRequest, runtime: Util.RuntimeOptions): DeleteFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFile',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFile(request: DeleteFileRequest): DeleteFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFileWithOptions(request, runtime);
}

model DeleteFunctionRequest {
  name?: string(name='Name', example='demoFunction'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-****-8a88d205e2b8'),
}

model DeleteFunctionResponseBody = {
  requestId?: string(name='RequestId', example='9D653EC3-8F53-4307-9B1C-52F5922384A6'),
}

model DeleteFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFunctionResponseBody(name='body'),
}

async function deleteFunctionWithOptions(request: DeleteFunctionRequest, runtime: Util.RuntimeOptions): DeleteFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFunction(request: DeleteFunctionRequest): DeleteFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFunctionWithOptions(request, runtime);
}

model DeleteSpaceRequest {
  spaceId?: string(name='SpaceId', example='92e26ea9-6450-4b40-9c20-xxxx'),
}

model DeleteSpaceResponseBody = {
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
}

model DeleteSpaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSpaceResponseBody(name='body'),
}

async function deleteSpaceWithOptions(request: DeleteSpaceRequest, runtime: Util.RuntimeOptions): DeleteSpaceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSpace',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSpace(request: DeleteSpaceRequest): DeleteSpaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSpaceWithOptions(request, runtime);
}

model DeleteWebHostingCertificateRequest {
  domain?: string(name='Domain', example='www.example.com'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model DeleteWebHostingCertificateResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='D85CAE0D-5B1F-4A56-B776-DEEA2B232E9F'),
}

model DeleteWebHostingCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWebHostingCertificateResponseBody(name='body'),
}

async function deleteWebHostingCertificateWithOptions(request: DeleteWebHostingCertificateRequest, runtime: Util.RuntimeOptions): DeleteWebHostingCertificateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domain)) {
    body['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWebHostingCertificate',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteWebHostingCertificate(request: DeleteWebHostingCertificateRequest): DeleteWebHostingCertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteWebHostingCertificateWithOptions(request, runtime);
}

model DeleteWebHostingFileRequest {
  filePath?: string(name='FilePath', example='/error.jpg'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model DeleteWebHostingFileResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model DeleteWebHostingFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWebHostingFileResponseBody(name='body'),
}

async function deleteWebHostingFileWithOptions(request: DeleteWebHostingFileRequest, runtime: Util.RuntimeOptions): DeleteWebHostingFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.filePath)) {
    body['FilePath'] = request.filePath;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWebHostingFile',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteWebHostingFile(request: DeleteWebHostingFileRequest): DeleteWebHostingFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteWebHostingFileWithOptions(request, runtime);
}

model DeleteWechatOpenPlatformConfigRequest {
  appId?: string(name='AppId', example='123456'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DeleteWechatOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='819BE656-D2E0-4858-8B21-B2E477085AAF'),
}

model DeleteWechatOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWechatOpenPlatformConfigResponseBody(name='body'),
}

async function deleteWechatOpenPlatformConfigWithOptions(request: DeleteWechatOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): DeleteWechatOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWechatOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteWechatOpenPlatformConfig(request: DeleteWechatOpenPlatformConfigRequest): DeleteWechatOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteWechatOpenPlatformConfigWithOptions(request, runtime);
}

model DeployFunctionRequest {
  deploymentId?: string(name='DeploymentId', example='dep-5e49fd471c9d4451c33bdd06'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-****-8a88d205e2b8xxxx'),
}

model DeployFunctionResponseBody = {
  requestId?: string(name='RequestId', example='9D653EC3-8F53-4307-9B1C-52F5922384A6'),
}

model DeployFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeployFunctionResponseBody(name='body'),
}

async function deployFunctionWithOptions(request: DeployFunctionRequest, runtime: Util.RuntimeOptions): DeployFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.deploymentId)) {
    body['DeploymentId'] = request.deploymentId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeployFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deployFunction(request: DeployFunctionRequest): DeployFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deployFunctionWithOptions(request, runtime);
}

model DescribeCdnDomainRequest {
  spaceId?: string(name='SpaceId', example='mp-05c3aa1c-****-43ae-a03d-61eff91c592e'),
  tenantId?: string(name='TenantId', example='UNIGTXQTAO'),
  type?: string(name='Type', example='FILE'),
}

model DescribeCdnDomainResponseBody = {
  authConfig?: {
    authDelta?: int32(name='AuthDelta', example='3600'),
    authKey?: string(name='AuthKey', example='SL4ZB****'),
    authType?: string(name='AuthType', example='no_auth'),
    configId?: string(name='configId', example='25950108534****'),
  }(name='AuthConfig'),
  corsConfig?: {
    accessOriginControl?: boolean(name='AccessOriginControl', example='true'),
    allowOrigin?: string(name='AllowOrigin', example='https://www.baidu.com'),
    configId?: string(name='ConfigId', example='274436853071****'),
  }(name='CorsConfig'),
  domainName?: string(name='DomainName', example='mp-65e6491b-****-4c2e-b202-7f0036eb2713.cdn.bspapp.com'),
  ipConfig?: {
    configId?: string(name='ConfigId', example='25623800702****'),
    ipList?: string(name='IpList', example='183.157.108.82,140.205.147.26'),
    type?: string(name='Type', example='black'),
  }(name='IpConfig'),
  refererConfig?: {
    allowEmpty?: string(name='AllowEmpty', example='on'),
    configId?: string(name='ConfigId', example='28048528682****'),
    disableAst?: string(name='DisableAst', example='a*b.example.com'),
    referList?: string(name='ReferList', example='a*b.example.com'),
    type?: string(name='Type', example='white'),
  }(name='RefererConfig'),
  requestId?: string(name='RequestId', example='E8A2FA95-6F70-****-971C-34C27485441D'),
  serviceStatus?: string(name='ServiceStatus', example='IN_SERVICE'),
  spaceId?: string(name='SpaceId', example='mp-65e6491b-****-4c2e-b202-7f0036eb2713'),
  uaConfig?: {
    configId?: string(name='ConfigId', example='25950108534****'),
    type?: string(name='Type', example='white'),
    uaList?: string(name='UaList', example='*curl*|*IE*|*chrome*|*firefox*'),
  }(name='UaConfig'),
}

model DescribeCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainResponseBody(name='body'),
}

async function describeCdnDomainWithOptions(request: DescribeCdnDomainRequest, runtime: Util.RuntimeOptions): DescribeCdnDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCdnDomain',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCdnDomain(request: DescribeCdnDomainRequest): DescribeCdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCdnDomainWithOptions(request, runtime);
}

model DescribeFCOpenStatusResponseBody = {
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-xxxx'),
  status?: string(name='Status', example='Opened'),
}

model DescribeFCOpenStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFCOpenStatusResponseBody(name='body'),
}

async function describeFCOpenStatusWithOptions(runtime: Util.RuntimeOptions): DescribeFCOpenStatusResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeFCOpenStatus',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeFCOpenStatus(): DescribeFCOpenStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFCOpenStatusWithOptions(runtime);
}

model DescribeFileUploadSignedUrlRequest {
  contentType?: string(name='ContentType', example='png'),
  fileId?: string(name='FileId', example='/abc/edf/hello.jpg'),
  filename?: string(name='Filename', example='wlop29.jpg'),
  size?: long(name='Size', example='41836'),
  spaceId?: string(name='SpaceId', example='mp-0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DescribeFileUploadSignedUrlResponseBody = {
  id?: string(name='Id', example='2fada31e-8fa5-****-b595-9698cd6b5f06'),
  ossCallbackUrl?: string(name='OssCallbackUrl', example='https://api.next.bspapp.com/oss_upload_callback'),
  overwrite?: boolean(name='Overwrite'),
  requestId?: string(name='RequestId', example='E9A50E1B-5ECE-42D4-B261-C07D1BBE68DE'),
  signUrl?: string(name='SignUrl', example='https://bsppub.oss-cn-shanghai.aliyuncs.com/FBPSBVMO-myspace/41552d60-52de-xxx-a713-43e879b0717a.JPG?OSSAccessKeyId=LTAIk****dtFueLA&Expires=1582152512&Signature=sek1B0Xm2r***tNvfX9tX%2BBJxA%3D'),
}

model DescribeFileUploadSignedUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFileUploadSignedUrlResponseBody(name='body'),
}

async function describeFileUploadSignedUrlWithOptions(request: DescribeFileUploadSignedUrlRequest, runtime: Util.RuntimeOptions): DescribeFileUploadSignedUrlResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.contentType)) {
    body['ContentType'] = request.contentType;
  }
  if (!Util.isUnset(request.fileId)) {
    body['FileId'] = request.fileId;
  }
  if (!Util.isUnset(request.filename)) {
    body['Filename'] = request.filename;
  }
  if (!Util.isUnset(request.size)) {
    body['Size'] = request.size;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeFileUploadSignedUrl',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeFileUploadSignedUrl(request: DescribeFileUploadSignedUrlRequest): DescribeFileUploadSignedUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFileUploadSignedUrlWithOptions(request, runtime);
}

model DescribeFunctionRequest {
  name?: string(name='Name', example='demoFunction'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-8514-xxxx'),
}

model DescribeFunctionResponseBody = {
  deployment?: {
    createdAt?: string(name='CreatedAt', example='2019-06-11T10:51:19Z'),
    deploymentId?: string(name='DeploymentId', example='dep-62020d3bea44fd4608118233'),
    downloadSignedUrl?: string(name='DownloadSignedUrl', example='http://bucket.oss-cn-shanghai.aliyuncs.com/xxxx-v2.zip?OSSAccessKeyId=LT*********1DkK6&Expires=1561425220&Signature=xEuiAgUMShQ4v8fYIl3FM8Jp3MA%3D'),
    modifiedAt?: string(name='ModifiedAt', example='2019-06-11T10:51:19Z'),
    versionNo?: string(name='VersionNo', example='2019061110511905080'),
  }(name='Deployment'),
  function?: {
    createdAt?: string(name='CreatedAt', example='2021-12-02T02:40:37Z'),
    desc?: string(name='Desc'),
    httpTriggerPath?: string(name='HttpTriggerPath', example='/http/getWxToken'),
    modifiedAt?: string(name='ModifiedAt', example='2019-06-21T02:22:53Z'),
    name?: string(name='Name', example='demoFunction'),
    spec?: {
      instanceConcurrency?: int32(name='InstanceConcurrency', example='1'),
      memory?: string(name='Memory', example='512'),
      runtime?: string(name='Runtime', example='nodejs12'),
      timeout?: string(name='Timeout', example='5'),
    }(name='Spec'),
    timingTriggerConfig?: string(name='TimingTriggerConfig'),
    timingTriggerUserPayload?: string(name='TimingTriggerUserPayload', example='hello'),
  }(name='Function'),
  requestId?: string(name='RequestId', example='75CE67BE-48E9-52AF-B965-4690270CD53A'),
}

model DescribeFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFunctionResponseBody(name='body'),
}

async function describeFunctionWithOptions(request: DescribeFunctionRequest, runtime: Util.RuntimeOptions): DescribeFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeFunction(request: DescribeFunctionRequest): DescribeFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFunctionWithOptions(request, runtime);
}

model DescribeHttpTriggerConfigRequest {
  spaceId?: string(name='SpaceId', example='34C45988-2B24-****-A4DC-4D6C952890D8'),
}

model DescribeHttpTriggerConfigResponseBody = {
  customDomain?: string(name='CustomDomain', example='abc.example.com'),
  customDomainCertificateInfo?: string(name='CustomDomainCertificateInfo', example='{"notAfter":"2021-09-28T08:21:42Z","notBefore":"2021-06-30T08:21:43Z","subject":"CN=*.example.com"}'),
  customDomainCname?: string(name='CustomDomainCname', example='724d************795a2.custom.bspapp.com'),
  defaultEndpoint?: string(name='DefaultEndpoint', example='724dade5-492f-426b-a5df-ff****0795a2.bspapp.com'),
  enableService?: boolean(name='EnableService', example='true'),
  requestId?: string(name='RequestId', example='4555773F-769B-4960-87E6-16009E5A4844'),
}

model DescribeHttpTriggerConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHttpTriggerConfigResponseBody(name='body'),
}

async function describeHttpTriggerConfigWithOptions(request: DescribeHttpTriggerConfigRequest, runtime: Util.RuntimeOptions): DescribeHttpTriggerConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHttpTriggerConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHttpTriggerConfig(request: DescribeHttpTriggerConfigRequest): DescribeHttpTriggerConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHttpTriggerConfigWithOptions(request, runtime);
}

model DescribeResourceQuotaRequest {
  spaceId?: string(name='SpaceId', example='226e5213-697c-****-b4ff-35a09f8a52de'),
}

model DescribeResourceQuotaResponseBody = {
  cloudStorageDataSizeQuota?: double(name='CloudStorageDataSizeQuota', example='10'),
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
  staticWebDataSizeQuota?: double(name='StaticWebDataSizeQuota', example='2'),
}

model DescribeResourceQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResourceQuotaResponseBody(name='body'),
}

async function describeResourceQuotaWithOptions(request: DescribeResourceQuotaRequest, runtime: Util.RuntimeOptions): DescribeResourceQuotaResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResourceQuota',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeResourceQuota(request: DescribeResourceQuotaRequest): DescribeResourceQuotaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceQuotaWithOptions(request, runtime);
}

model DescribeResourceUsageRequest {
  endTime?: string(name='EndTime', example='2021-10-02T00:00:00Z'),
  format?: string(name='Format', example='JSON'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='100'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-****-b4ff-35a09f8a52de'),
  startTime?: string(name='StartTime', example='2021-10-01T00:00:00Z'),
}

model DescribeResourceUsageResponseBody = {
  code?: string(name='Code', example='success'),
  dataList?: [ 
    {
      cloudDB?: {
        dataSize?: long(name='DataSize', example='0'),
        read?: long(name='Read', example='0'),
        write?: long(name='Write', example='0'),
      }(name='CloudDB'),
      cloudFunction?: {
        compute?: long(name='Compute', example='0'),
        count?: long(name='Count', example='0'),
        traffic?: long(name='Traffic', example='0'),
      }(name='CloudFunction'),
      cloudStorage?: {
        dataSize?: long(name='DataSize', example='0'),
        download?: long(name='Download', example='0'),
        traffic?: long(name='Traffic', example='0'),
        upload?: long(name='Upload', example='0'),
      }(name='CloudStorage'),
      endTime?: string(name='EndTime', example='2021-10-01T16:00:00Z'),
      startTime?: string(name='StartTime', example='2021-10-01T15:00:00Z'),
      staticWeb?: {
        dataSize?: long(name='DataSize', example='0'),
        traffic?: long(name='Traffic', example='0'),
      }(name='StaticWeb'),
    }
  ](name='DataList'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='SpaceNotExist'),
  paginator?: {
    pageCount?: long(name='PageCount', example='3'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='100'),
    total?: long(name='Total', example='255'),
  }(name='Paginator'),
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
  success?: boolean(name='Success', example='true'),
}

model DescribeResourceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResourceUsageResponseBody(name='body'),
}

async function describeResourceUsageWithOptions(request: DescribeResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeResourceUsageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.format)) {
    body['Format'] = request.format;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResourceUsage',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeResourceUsage(request: DescribeResourceUsageRequest): DescribeResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceUsageWithOptions(request, runtime);
}

model DescribeServicePolicyRequest {
  collectionName?: string(name='CollectionName', example='test'),
  serviceName?: string(name='ServiceName', example='db'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DescribeServicePolicyResponseBody = {
  collectionName?: string(name='CollectionName', example='test'),
  policy?: string(name='Policy', example='{\\".write\\":false,\\".read\\":true}'),
  policyName?: string(name='PolicyName', example='ADMINWRITEONLY'),
  requestId?: string(name='RequestId', example='15F08A3A-DDBC-4199-93CA-343419E81235'),
  serviceName?: string(name='ServiceName', example='db'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model DescribeServicePolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeServicePolicyResponseBody(name='body'),
}

async function describeServicePolicyWithOptions(request: DescribeServicePolicyRequest, runtime: Util.RuntimeOptions): DescribeServicePolicyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.collectionName)) {
    body['CollectionName'] = request.collectionName;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['ServiceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeServicePolicy',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeServicePolicy(request: DescribeServicePolicyRequest): DescribeServicePolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeServicePolicyWithOptions(request, runtime);
}

model DescribeSpaceClientConfigRequest {
  detail?: string(name='Detail', example='true'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-4a52-b4ff-35a09f8*****'),
  workspaceId?: long(name='WorkspaceId', example='211975XXXX'),
}

model DescribeSpaceClientConfigResponseBody = {
  apiKey?: string(name='ApiKey', example='0a4gJT0faV*****D4lgQmw=='),
  endpoint?: string(name='Endpoint', example='226e5213-697c-4a52-b4ff-35a09f8*****'),
  fileUploadEndpoint?: string(name='FileUploadEndpoint', example='cocdsfmb-12266946259*****-file.oss-cn-zhangjiakou.aliyuncs.com'),
  name?: string(name='Name', example='myspace'),
  privateKey?: string(name='PrivateKey', example='-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhki******G9w0BAQE7V0sQaj\\n-----END PRIVATE KEY-----'),
  requestId?: string(name='RequestId', example='EA770971-A4A0-4555-9E00-C94A2194E150'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-4a52-b4ff-35a09f8*****'),
}

model DescribeSpaceClientConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSpaceClientConfigResponseBody(name='body'),
}

async function describeSpaceClientConfigWithOptions(request: DescribeSpaceClientConfigRequest, runtime: Util.RuntimeOptions): DescribeSpaceClientConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.detail)) {
    body['Detail'] = request.detail;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSpaceClientConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSpaceClientConfig(request: DescribeSpaceClientConfigRequest): DescribeSpaceClientConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSpaceClientConfigWithOptions(request, runtime);
}

model DescribeSpacesRequest {
  emasWorkspaceId?: long(name='EmasWorkspaceId', example='3449110'),
  pageNum?: int32(name='PageNum', example='0'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceIds?: [ string ](name='SpaceIds'),
  specCode?: string(name='SpecCode', example='ULTIMATE'),
  tenantId?: string(name='TenantId', example='XKHKTPDJ'),
}

model DescribeSpacesShrinkRequest {
  emasWorkspaceId?: long(name='EmasWorkspaceId', example='3449110'),
  pageNum?: int32(name='PageNum', example='0'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceIdsShrink?: string(name='SpaceIds'),
  specCode?: string(name='SpecCode', example='ULTIMATE'),
  tenantId?: string(name='TenantId', example='XKHKTPDJ'),
}

model DescribeSpacesResponseBody = {
  count?: int32(name='Count', example='10'),
  gmtCreate?: string(name='GmtCreate', example='-'),
  requestId?: string(name='RequestId', example='68B76E59-CC10-5EEC-BCED-73A6C51179BC'),
  spaces?: [ 
    {
      autoRenew?: boolean(name='AutoRenew', example='true'),
      chargeType?: string(name='ChargeType', example='PREPAY'),
      description?: string(name='Description'),
      emasWorkspaceId?: long(name='EmasWorkspaceId', example='3818905'),
      gmtCreate?: string(name='GmtCreate', example='2022-05-19T06:06:05Z'),
      gmtModified?: string(name='GmtModified', example='2022-05-19T06:06:05Z'),
      instanceId?: string(name='InstanceId', example='emas_EmasServerlessPre_public_cn-0ju2pax****'),
      name?: string(name='Name', example='myspace'),
      orderType?: string(name='OrderType', example='BUY'),
      packageEndDate?: string(name='PackageEndDate', example='2022-09-18T16:00:00Z'),
      packageStartDate?: string(name='PackageStartDate', example='2022-06-18T16:00:00Z'),
      packageStatus?: string(name='PackageStatus', example='UPGRADING'),
      renewDuration?: string(name='RenewDuration', example='3'),
      serviceStatus?: string(name='ServiceStatus', example='IN_SERVICE'),
      spaceId?: string(name='SpaceId', example='mp-f215973f-db40-4013-92a8-b09690c7****'),
      specCode?: string(name='SpecCode', example='ENTERPRISE'),
    }
  ](name='Spaces'),
}

model DescribeSpacesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSpacesResponseBody(name='body'),
}

async function describeSpacesWithOptions(tmpReq: DescribeSpacesRequest, runtime: Util.RuntimeOptions): DescribeSpacesResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeSpacesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.spaceIds)) {
    request.spaceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.spaceIds, 'SpaceIds', 'simple');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.emasWorkspaceId)) {
    body['EmasWorkspaceId'] = request.emasWorkspaceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.spaceIdsShrink)) {
    body['SpaceIds'] = request.spaceIdsShrink;
  }
  if (!Util.isUnset(request.specCode)) {
    body['SpecCode'] = request.specCode;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSpaces',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSpaces(request: DescribeSpacesRequest): DescribeSpacesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSpacesWithOptions(request, runtime);
}

model DescribeWebHostingFileRequest {
  filePath?: string(name='FilePath', example='/error.png'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model DescribeWebHostingFileResponseBody = {
  data?: {
    contentType?: string(name='ContentType', example='image/png'),
    ETag?: string(name='ETag', example='test'),
    exists?: boolean(name='Exists', example='true'),
    filePath?: string(name='FilePath', example='/error.png'),
    lastModifiedTime?: long(name='LastModifiedTime', example='1590398956000'),
    signedUrl?: string(name='SignedUrl', example='http://fbpsbvmo-154159039388****-static.oss-cn-zhangjiakou.aliyuncs.com/0e16bb12-14af-4635-b24c-5ac1a9a*****/error.png?Expires=1590460358&OSSAccessKeyId=STS.NUcPHyHQr2xQ6zAe5ybi*****&Signature=b2L4kBEFrA2EZvZbm3B%2FyNSxVeA%3D&security-token=CAISgQJ1q6Ft5B2yfSjIr5bWG%2FLNpY5Thbq6NFzwgTUsbuZ4grfe0Tz2IHBEeXRuA%2B0WsvQ%2Bnm9X6vgelqFZYqRoYGHiUZOjKEbIPUXzDbDasumZsJYm6vT8a0XxZjf%2F2MjNGZabKPrWZvaqbX3diyZ32sGUXD6%2BXlujQ%2Fbr4NwdGbZxZASjaidcD9p7PxZrrNRgVUHcLvGwKBXn8AGyZQhKwlMh1ToiuPzkk5bMukuE1gXAp7VL99irEP%2BNdNJxOZpzadCx0dFte7DJuCwqsEgaqfoo1vEUpWeW5I7CXwcN%2BWePN%2BvF79tuIEpwae0gEqsBtv%2F4mLhxtunSkZQQTrutnEPAOhqAAU49tl4awl%2F0fID3wRpPDCKqg%2BfXifeRRPI2Tr%2Bm4PmK4qPffsI%2F5JXB4JA71uN5TkvMC6LxxTuQnJaTateDrfEDnzyyIVISjvQ7rzt8sxZCnDDfjzx6Lc5TAELuapDjeXK6w%2BWkbhwBTWcjrGAJvdaOA4IodaPZyDlyhO4jt1nv'),
    size?: long(name='Size', example='235628'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='93FC5921-2A54-408B-B360-2E5C93488CF4'),
}

model DescribeWebHostingFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeWebHostingFileResponseBody(name='body'),
}

async function describeWebHostingFileWithOptions(request: DescribeWebHostingFileRequest, runtime: Util.RuntimeOptions): DescribeWebHostingFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.filePath)) {
    body['FilePath'] = request.filePath;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWebHostingFile',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeWebHostingFile(request: DescribeWebHostingFileRequest): DescribeWebHostingFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWebHostingFileWithOptions(request, runtime);
}

model EnableExtensionRequest {
  extensionId?: string(name='ExtensionId', example='ext-5d53a4fb1c9d446e2075a2cc'),
}

model EnableExtensionResponseBody = {
  requestId?: string(name='RequestId', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model EnableExtensionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableExtensionResponseBody(name='body'),
}

async function enableExtensionWithOptions(request: EnableExtensionRequest, runtime: Util.RuntimeOptions): EnableExtensionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.extensionId)) {
    body['ExtensionId'] = request.extensionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableExtension',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableExtension(request: EnableExtensionRequest): EnableExtensionResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableExtensionWithOptions(request, runtime);
}

model GetWebHostingCertificateDetailRequest {
  customDomain?: string(name='CustomDomain', example='www.example.com'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a7bb9f'),
}

model GetWebHostingCertificateDetailResponseBody = {
  data?: {
    certDomainName?: string(name='CertDomainName', example='www.example.com'),
    certExpiredTime?: long(name='CertExpiredTime', example='1621252800000'),
    certLife?: string(name='CertLife', example='1 years'),
    certName?: string(name='CertName', example='test'),
    certType?: string(name='CertType', example='upload'),
    serverCertificateStatus?: string(name='ServerCertificateStatus', example='on'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='D85CAE0D-5B1F-4A56-B776-DEEA2B232E9F'),
}

model GetWebHostingCertificateDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebHostingCertificateDetailResponseBody(name='body'),
}

async function getWebHostingCertificateDetailWithOptions(request: GetWebHostingCertificateDetailRequest, runtime: Util.RuntimeOptions): GetWebHostingCertificateDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.customDomain)) {
    body['CustomDomain'] = request.customDomain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetWebHostingCertificateDetail',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWebHostingCertificateDetail(request: GetWebHostingCertificateDetailRequest): GetWebHostingCertificateDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWebHostingCertificateDetailWithOptions(request, runtime);
}

model GetWebHostingConfigRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model GetWebHostingConfigResponseBody = {
  data?: {
    allowedIps?: string(name='AllowedIps', example='42.120.72.0/24'),
    defaultDomain?: string(name='DefaultDomain', example='static-0e16bb12-14af-4635-b24c-5ac1a9a*****.bspapp.com'),
    errorHttpStatus?: string(name='ErrorHttpStatus'),
    errorPath?: string(name='ErrorPath', example='error.html'),
    indexPath?: string(name='IndexPath', example='index.html'),
    spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='828A8808-3FC9-418C-893A-5A708CFABB8E'),
}

model GetWebHostingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebHostingConfigResponseBody(name='body'),
}

async function getWebHostingConfigWithOptions(request: GetWebHostingConfigRequest, runtime: Util.RuntimeOptions): GetWebHostingConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetWebHostingConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWebHostingConfig(request: GetWebHostingConfigRequest): GetWebHostingConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWebHostingConfigWithOptions(request, runtime);
}

model GetWebHostingDomainVerificationContentRequest {
  domain?: string(name='Domain', example='example.com'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model GetWebHostingDomainVerificationContentResponseBody = {
  data?: {
    content?: string(name='Content', example='verify_c28a8e24b4bc9fab22d949cebdb1d7ae'),
    domain?: string(name='Domain', example='example.com'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='74374923-6536-46EB-8639-409384EAE980'),
}

model GetWebHostingDomainVerificationContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebHostingDomainVerificationContentResponseBody(name='body'),
}

async function getWebHostingDomainVerificationContentWithOptions(request: GetWebHostingDomainVerificationContentRequest, runtime: Util.RuntimeOptions): GetWebHostingDomainVerificationContentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domain)) {
    body['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetWebHostingDomainVerificationContent',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWebHostingDomainVerificationContent(request: GetWebHostingDomainVerificationContentRequest): GetWebHostingDomainVerificationContentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWebHostingDomainVerificationContentWithOptions(request, runtime);
}

model GetWebHostingStatusRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model GetWebHostingStatusResponseBody = {
  data?: {
    spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
    status?: string(name='Status', example='OPENING'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='D8F7FDDC-4EF3-44B9-9452-CFD7A081FB85'),
}

model GetWebHostingStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebHostingStatusResponseBody(name='body'),
}

async function getWebHostingStatusWithOptions(request: GetWebHostingStatusRequest, runtime: Util.RuntimeOptions): GetWebHostingStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetWebHostingStatus',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWebHostingStatus(request: GetWebHostingStatusRequest): GetWebHostingStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWebHostingStatusWithOptions(request, runtime);
}

model GetWebHostingUploadCredentialRequest {
  filePath?: string(name='FilePath', example='/'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model GetWebHostingUploadCredentialResponseBody = {
  data?: {
    accessKeyId?: string(name='AccessKeyId', example='STS.NUcPHyHQr2xQ6zAe5ybi*****'),
    endpoint?: string(name='Endpoint', example='fbpsbvmo-154159039388***-static.oss-cn-zhangjiakou.aliyuncs.com'),
    expiredTime?: long(name='ExpiredTime', example='1590460358'),
    filePath?: string(name='FilePath', example='/'),
    policy?: string(name='Policy', example='eyJleHBpcmF0aW9uIjoiMjAyMC0wNS0yNlQwNjozMjoxOC43NTZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsNTI0Mjg4MDBdLHsia2V5IjoiMGUxNmJiMTItMTRhZi00NjM1LWIyNGMtNWFjMWE5YTdiYjlmL2Zvcm1hdC5qc29uIn1dfQ=='),
    securityToken?: string(name='SecurityToken', example='CAISgQJ1q6Ft5B2yfSjIr5bWG%2FLNpY5Thbq6NFzwgTUsbuZ4grfe0Tz2IHBEeXRuA%2B0WsvQ%2Bnm9X6vgelqFZYqRoYGHiUZOjKEbIPUXzDbDasumZsJYm6vT8a0XxZjf%2F2MjNGZabKPrWZvaqbX3diyZ32sGUXD6%2BXlujQ%2Fbr4NwdGbZxZASjaidcD9p7PxZrrNRgVUHcLvGwKBXn8AGyZQhKwlMh1ToiuPzkk5bMukuE1gXAp7VL99irEP%2BNdNJxOZpzadCx0dFte7DJuCwqsEgaqfoo1vEUpWeW5I7CXwcN%2BWePN%2BvF79tuIEpwae0gEqsBtv%2F4mLhxtunSkZQQTrutnEPAOhqAAU49tl4awl%2F0fID3wRpPDCKqg%2BfXifeRRPI2Tr%2Bm4PmK4qPffsI%2F5JXB4JA71uN5TkvMC6LxxTuQnJaTateDrfEDnzyyIVISjvQ7rzt8sxZCnDDfjzx6Lc5TAELuapDjeXK6w%2BWkbhwBTWcjrGAJvdaOA4IodaPZyDlyhO4jt1nv'),
    signature?: string(name='Signature', example='w7ke9GsiFjb2bR7bQNOOTk4nlbA'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='93FC5921-2A54-408B-B360-2E5C93488CF4'),
}

model GetWebHostingUploadCredentialResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebHostingUploadCredentialResponseBody(name='body'),
}

async function getWebHostingUploadCredentialWithOptions(request: GetWebHostingUploadCredentialRequest, runtime: Util.RuntimeOptions): GetWebHostingUploadCredentialResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.filePath)) {
    body['FilePath'] = request.filePath;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetWebHostingUploadCredential',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWebHostingUploadCredential(request: GetWebHostingUploadCredentialRequest): GetWebHostingUploadCredentialResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWebHostingUploadCredentialWithOptions(request, runtime);
}

model ListCorsDomainsRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model ListCorsDomainsResponseBody = {
  domains?: [ 
    {
      domain?: string(name='Domain', example='example.com'),
      domainId?: string(name='DomainId', example='97e3ff58-01e4-****-b975-1805fec34d77'),
    }
  ](name='Domains'),
  requestId?: string(name='RequestId', example='ED81670E-570A-481C-A50D-6B0EAA823BB1'),
}

model ListCorsDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCorsDomainsResponseBody(name='body'),
}

async function listCorsDomainsWithOptions(request: ListCorsDomainsRequest, runtime: Util.RuntimeOptions): ListCorsDomainsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListCorsDomains',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listCorsDomains(request: ListCorsDomainsRequest): ListCorsDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCorsDomainsWithOptions(request, runtime);
}

model ListDingtalkOpenPlatformConfigsRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model ListDingtalkOpenPlatformConfigsResponseBody = {
  configs?: [ 
    {
      appId?: string(name='AppId', example='dingoa7pqicyk3x9******'),
      appSecret?: string(name='AppSecret', example='1r0ElNPFqLI6qgY08*******************************9TIK3RN_5fk9SEMO'),
      createTime?: string(name='CreateTime', example='2020-01-17T03:04:46Z'),
      updateTime?: string(name='UpdateTime', example='2020-01-17T03:04:46Z'),
    }
  ](name='Configs'),
  requestId?: string(name='RequestId', example='D8A5FF68-2C8A-46D0-A11C-FA034F4F475F'),
}

model ListDingtalkOpenPlatformConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDingtalkOpenPlatformConfigsResponseBody(name='body'),
}

async function listDingtalkOpenPlatformConfigsWithOptions(request: ListDingtalkOpenPlatformConfigsRequest, runtime: Util.RuntimeOptions): ListDingtalkOpenPlatformConfigsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDingtalkOpenPlatformConfigs',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDingtalkOpenPlatformConfigs(request: ListDingtalkOpenPlatformConfigsRequest): ListDingtalkOpenPlatformConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDingtalkOpenPlatformConfigsWithOptions(request, runtime);
}

model ListExtensionsRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListExtensionsResponseBody = {
  extensions?: [ 
    {
      enabled?: string(name='Enabled', example='true'),
      extensionDesc?: string(name='ExtensionDesc'),
      extensionDocumentationLink?: string(name='ExtensionDocumentationLink', example='https://help.aliyun.com/document_detail/137586.html'),
      extensionId?: string(name='ExtensionId', example='ext-5d53a4fb1c9d446e2075a2cc'),
      extensionName?: string(name='ExtensionName'),
    }
  ](name='Extensions'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='DD0F8BC9-516F-4AEF-8D95-D290C2296D78'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListExtensionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExtensionsResponseBody(name='body'),
}

async function listExtensionsWithOptions(request: ListExtensionsRequest, runtime: Util.RuntimeOptions): ListExtensionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListExtensions',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listExtensions(request: ListExtensionsRequest): ListExtensionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExtensionsWithOptions(request, runtime);
}

model ListFileRequest {
  authDelta?: int32(name='AuthDelta'),
  fileId?: string(name='FileId', example='id1'),
  keyword?: string(name='Keyword'),
  mode?: string(name='Mode', example='DIRECTORY'),
  nextToken?: string(name='NextToken', example='CAESBgoEIgIIABgAIrQBCrEBA6wAAAAxTDdmZmZmZmZmZjg5OWJlMzguUzZkNzAyZDY2Mz***'),
  pageSize?: int32(name='PageSize', example='10'),
  prefix?: string(name='Prefix', example='/images'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-xxxx-5ac1a9a7bb9f'),
}

model ListFileResponseBody = {
  dataList?: [ 
    {
      authDelta?: int32(name='AuthDelta'),
      gmtCreate?: string(name='GmtCreate', example='2020-01-16T05:45:33.000Z'),
      gmtModified?: string(name='GmtModified', example='2020-01-16T05:45:33.000Z'),
      id?: string(name='Id', example='c568f23d-a46f-4866-xxxx-142e5eb3e174'),
      name?: string(name='Name', example='1579153532001.JPG'),
      size?: int32(name='Size', example='1000'),
      type?: string(name='Type', example='JPG'),
      url?: string(name='Url', example='https://fbpxxx.cdn.bspapp.com/FBPSBVMO-myspace/68dbd670-3823-11ea-bfb9-xxxx.JPG'),
    }
  ](name='DataList'),
  paginator?: {
    nextToken?: string(name='NextToken', example='eyJhY2NvdW50IjoiMTE2MTQwNTMxMDE0OTY2OCIsImV2ZW50SWQiOiIzMkI3QTE1Mi05NUJFLTUyNkMtQjEyNC00RUYxRDk2RDM4QkEiLCJsb2dJZCI6IjE0LTExNjE0MDUzMTAxNDk2NjgiLCJ0aW1lIjoxNjM1MjEzMzk0MDAwfQ'),
    pageSize?: int32(name='PageSize', example='10'),
  }(name='Paginator'),
  requestId?: string(name='RequestId', example='FE88BEC8-8F83-408A-9ED3-771C510C705F'),
}

model ListFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFileResponseBody(name='body'),
}

async function listFileWithOptions(request: ListFileRequest, runtime: Util.RuntimeOptions): ListFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.authDelta)) {
    body['AuthDelta'] = request.authDelta;
  }
  if (!Util.isUnset(request.fileId)) {
    body['FileId'] = request.fileId;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.mode)) {
    body['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.prefix)) {
    body['Prefix'] = request.prefix;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListFile',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFile(request: ListFileRequest): ListFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFileWithOptions(request, runtime);
}

model ListFunctionRequest {
  filterBy?: string(name='FilterBy', example='demo'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-****-8a88d205e2b8'),
}

model ListFunctionResponseBody = {
  dataList?: [ 
    {
      createdAt?: string(name='CreatedAt', example='2019-06-21T02:22:55.996Z'),
      desc?: string(name='Desc', example='test'),
      httpTriggerPath?: string(name='HttpTriggerPath', example='/http/hello'),
      modifiedAt?: string(name='ModifiedAt', example='2019-06-21T02:22:55.996Z'),
      name?: string(name='Name', example='demoFunction'),
      spec?: {
        instanceConcurrency?: int32(name='InstanceConcurrency', example='1'),
        memory?: string(name='Memory', example='128 MB'),
        runtime?: string(name='Runtime', example='Node.js 8'),
        timeout?: string(name='Timeout', example='5s'),
      }(name='Spec'),
      timingTriggerConfig?: string(name='TimingTriggerConfig', example='cron:0 0 * * * *'),
    }
  ](name='DataList'),
  paginator?: {
    pageCount?: int32(name='PageCount', example='1'),
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Paginator'),
  requestId?: string(name='RequestId', example='D388FE2B-61D5-4A76-A8F0-xxxx'),
}

model ListFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFunctionResponseBody(name='body'),
}

async function listFunctionWithOptions(request: ListFunctionRequest, runtime: Util.RuntimeOptions): ListFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.filterBy)) {
    body['FilterBy'] = request.filterBy;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFunction(request: ListFunctionRequest): ListFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFunctionWithOptions(request, runtime);
}

model ListFunctionDeploymentRequest {
  name?: string(name='Name', example='demoFunction'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-****-8a88d205e2b8'),
  status?: string(name='Status', example='DEPLOY_SUCCESS'),
}

model ListFunctionDeploymentResponseBody = {
  dataList?: [ 
    {
      createdAt?: string(name='CreatedAt', example='2019-06-21T02:22:53.309Z'),
      deploymentId?: string(name='DeploymentId', example='dep-5e49fd471c9d4451c33bdd06'),
      downloadSignedUrl?: string(name='DownloadSignedUrl', example='http://function-apiserver-test.oss-cn-shanghai.aliyuncs.com/5d0afc0e1c9d44*****32c30a-v5.zip?OSSAccessKeyId=LTA************&Expires=1561425220&Signature=SAgUkZFK54eAbU6TLT9zMZ7S8eg%3D'),
      modifiedAt?: string(name='ModifiedAt', example='2019-06-21T02:22:55.996Z'),
      status?: {
        label?: string(name='Label'),
        status?: string(name='Status', example='DEPLOY_SUCCESS'),
      }(name='Status'),
      versionNo?: string(name='VersionNo', example='2019061110511930090'),
    }
  ](name='DataList'),
  paginator?: {
    pageCount?: int32(name='PageCount', example='1'),
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Paginator'),
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
}

model ListFunctionDeploymentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFunctionDeploymentResponseBody(name='body'),
}

async function listFunctionDeploymentWithOptions(request: ListFunctionDeploymentRequest, runtime: Util.RuntimeOptions): ListFunctionDeploymentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListFunctionDeployment',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFunctionDeployment(request: ListFunctionDeploymentRequest): ListFunctionDeploymentResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFunctionDeploymentWithOptions(request, runtime);
}

model ListFunctionLogRequest {
  fromDate?: long(name='FromDate', example='1560134212326'),
  logRequestId?: string(name='LogRequestId', example='0a206a521561344642018387523432'),
  name?: string(name='Name', example='demoFunction'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceId?: string(name='SpaceId', example='dece4ea0-****-4cfa-8514-8a88d205e2b8'),
  status?: string(name='Status', example='SUCCESS'),
  toDate?: long(name='ToDate', example='1560134212326'),
}

model ListFunctionLogResponseBody = {
  dataList?: [ 
    {
      contents?: [ string ](name='Contents'),
      functionName?: string(name='FunctionName', example='demoFunction'),
      levels?: [ string ](name='Levels'),
      requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
      spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-8514-8a88d205e2b8'),
      status?: string(name='Status', example='SUCCESS'),
      timestamps?: [ string ](name='Timestamps'),
    }
  ](name='DataList'),
  paginator?: {
    pageCount?: int32(name='PageCount', example='1'),
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    total?: int32(name='Total', example='1'),
  }(name='Paginator'),
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
}

model ListFunctionLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFunctionLogResponseBody(name='body'),
}

async function listFunctionLogWithOptions(request: ListFunctionLogRequest, runtime: Util.RuntimeOptions): ListFunctionLogResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.fromDate)) {
    body['FromDate'] = request.fromDate;
  }
  if (!Util.isUnset(request.logRequestId)) {
    body['LogRequestId'] = request.logRequestId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.toDate)) {
    body['ToDate'] = request.toDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListFunctionLog',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFunctionLog(request: ListFunctionLogRequest): ListFunctionLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFunctionLogWithOptions(request, runtime);
}

model ListOpenPlatformConfigRequest {
  platform?: string(name='Platform', example='Alipay'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model ListOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='2540E86F-2CD4-44AC-A7AB-59CAF40C225D'),
  secretList?: [ 
    {
      appCert?: string(name='AppCert', example='-----BEGIN CERTIFICATE----- MIIEwTCCA6mgAwIBAgIQICAJGbUNoqdPr25qpPU7+ -----END CERTIFICATE-----'),
      appId?: string(name='AppId', example='201909116717****'),
      appSecret?: string(name='AppSecret', example='1r0ElNPFqLI6qgY08*******************************9TIK3RN_5fk9SEMO'),
      platform?: string(name='Platform', example='Alipay'),
      privateKey?: string(name='PrivateKey', example='MIIEvgIBADANBgkqhkiG9w0BAQEFAAS'),
      publicCert?: string(name='PublicCert', example='-----BEGIN CERTIFICATE----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQ -----END CERTIFICATE-----'),
      publicKey?: string(name='PublicKey', example='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ'),
      rootCert?: string(name='RootCert', example='-----BEGIN CERTIFICATE----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQ -----END CERTIFICATE-----'),
      signMode?: string(name='SignMode', example='CERT'),
      spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
    }
  ](name='SecretList'),
}

model ListOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOpenPlatformConfigResponseBody(name='body'),
}

async function listOpenPlatformConfigWithOptions(request: ListOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): ListOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.platform)) {
    body['Platform'] = request.platform;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOpenPlatformConfig(request: ListOpenPlatformConfigRequest): ListOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOpenPlatformConfigWithOptions(request, runtime);
}

model ListSpaceRequest {
  emasWorkspaceId?: string(name='EmasWorkspaceId', example='3821658'),
  pageNum?: int32(name='PageNum', example='0'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceIds?: [ string ](name='SpaceIds'),
}

model ListSpaceShrinkRequest {
  emasWorkspaceId?: string(name='EmasWorkspaceId', example='3821658'),
  pageNum?: int32(name='PageNum', example='0'),
  pageSize?: int32(name='PageSize', example='10'),
  spaceIdsShrink?: string(name='SpaceIds'),
}

model ListSpaceResponseBody = {
  count?: int32(name='Count', example='23'),
  gmtCreate?: string(name='GmtCreate'),
  requestId?: string(name='RequestId', example='B314EDAD-FFCA-536D-BA9C-08B42F7C2DDE'),
  spaces?: [ 
    {
      desc?: string(name='Desc'),
      gmtCreate?: long(name='GmtCreate', example='1582018007000'),
      gmtLastAccess?: long(name='GmtLastAccess', example='1582018007000'),
      name?: string(name='Name', example='myspace'),
      spaceId?: string(name='SpaceId', example='368ef42a-763f-0000-acc2-8aa9564c****'),
      status?: string(name='Status', example='IN_SERVICE'),
    }
  ](name='Spaces'),
}

model ListSpaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSpaceResponseBody(name='body'),
}

async function listSpaceWithOptions(tmpReq: ListSpaceRequest, runtime: Util.RuntimeOptions): ListSpaceResponse {
  Util.validateModel(tmpReq);
  var request = new ListSpaceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.spaceIds)) {
    request.spaceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.spaceIds, 'SpaceIds', 'simple');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.emasWorkspaceId)) {
    body['EmasWorkspaceId'] = request.emasWorkspaceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.spaceIdsShrink)) {
    body['SpaceIds'] = request.spaceIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSpace',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listSpace(request: ListSpaceRequest): ListSpaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSpaceWithOptions(request, runtime);
}

model ListWebHostingCustomDomainsRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model ListWebHostingCustomDomainsResponseBody = {
  data?: [ 
    {
      accessControlAllowOrigin?: string(name='AccessControlAllowOrigin', example='https://*.example.com, https://*.example.org'),
      accessOriginControl?: boolean(name='AccessOriginControl'),
      cname?: string(name='Cname', example='www.test.com.w.kunlungr.com'),
      createTime?: long(name='CreateTime', example='1590470646000'),
      description?: string(name='Description'),
      domain?: string(name='Domain', example='www.test.com'),
      enableCors?: boolean(name='EnableCors', example='true'),
      forceRedirectType?: string(name='ForceRedirectType', example='HTTPS_FORCE'),
      sslProtocol?: string(name='SslProtocol', example='off'),
      status?: string(name='Status', example='online'),
      updateTime?: long(name='UpdateTime', example='1590470646143'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='93FC5921-2A54-408B-B360-2E5C93488CF4'),
}

model ListWebHostingCustomDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebHostingCustomDomainsResponseBody(name='body'),
}

async function listWebHostingCustomDomainsWithOptions(request: ListWebHostingCustomDomainsRequest, runtime: Util.RuntimeOptions): ListWebHostingCustomDomainsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListWebHostingCustomDomains',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listWebHostingCustomDomains(request: ListWebHostingCustomDomainsRequest): ListWebHostingCustomDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWebHostingCustomDomainsWithOptions(request, runtime);
}

model ListWebHostingFilesRequest {
  marker?: string(name='Marker', example='0e16bb12-14af-4635-b24c-5ac1a9a*****/test/error1.png'),
  pageSize?: int32(name='PageSize', example='100'),
  prefix?: string(name='Prefix', example='/'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model ListWebHostingFilesResponseBody = {
  data?: {
    count?: int32(name='Count', example='50'),
    nextMarker?: string(name='NextMarker', example='0e16bb12-14af-4635-b24c-5ac1a9a*****/test/error1.png'),
    webHostingFiles?: [ 
      {
        contentType?: string(name='ContentType', example='image/png'),
        ETag?: string(name='ETag', example='test'),
        filePath?: string(name='FilePath', example='error/error.jpg'),
        lastModifiedTime?: long(name='LastModifiedTime', example='1590398956000'),
        signedUrl?: string(name='SignedUrl', example='http://fbpsbvmo-15415903938*****-static.oss-cn-zhangjiakou.aliyuncs.com/0e16bb12-14af-4635-b24c-5ac1a9a*****/test/error.jpg?Expires=1590462873&OSSAccessKeyId=STS.NT9oaFvbRzj8vSViJL2y*****&Signature=pSMbsZUZGwfZEcvT9R7VZPMp%2BVA%3D&security-token=CAISgQJ1q6Ft5B2yfSjIr5eMJNvym71zzajTdHXnjUoZPvYVjIHgpjz2IHBEeXRuA%2B0WsvQ%2Bnm9X6vgelqFZYqRoYGHiUZOgBG3HPUXzDbDasumZsJYm6vT8a0XxZjf%2F2MjNGZabKPrWZvaqbX3diyZ32sGUXD6%2BXlujQ%2Fbr4NwdGbZxZASjaidcD9p7PxZrrNRgVUHcLvGwKBXn8AGyZQhKwlMh1ToiuPzkk5bMukuE1gXAp7VL99irEP%2BNdNJxOZpzadCx0dFte7DJuCwqsEgaqfoo1vEUpWeW5I7CXwcN%2BWePN%2BvF79tuIEpwae0gEqsBtv%2F4mLhxtunSkZQQTrutnEPAOhqAAZ6L6gVhZYEK78ZBsQq1hP9nvtEGENelJYiTPWAHmB1mDutOaEzgSpwVMaP3FWpMTy6KgBKMox1NJLUZJK23NlJIlMIJ8lVyCQOG4Ig7oTXTbFc0PQMShK%2FeQIQ2WvZ2x%2F%2FZdgaZIeQR4WnawsWF%2BYC4ScTig0wYTuaLx7pH2WHJ'),
        size?: long(name='Size', example='235628'),
      }
    ](name='WebHostingFiles'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='93FC5921-2A54-408B-B360-2E5C93488CF4'),
}

model ListWebHostingFilesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebHostingFilesResponseBody(name='body'),
}

async function listWebHostingFilesWithOptions(request: ListWebHostingFilesRequest, runtime: Util.RuntimeOptions): ListWebHostingFilesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.marker)) {
    body['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.prefix)) {
    body['Prefix'] = request.prefix;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListWebHostingFiles',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listWebHostingFiles(request: ListWebHostingFilesRequest): ListWebHostingFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWebHostingFilesWithOptions(request, runtime);
}

model ModifyWebHostingConfigRequest {
  allowedIps?: string(name='AllowedIps', example='42.120.72.0/24'),
  errorHttpStatus?: string(name='ErrorHttpStatus'),
  errorPath?: string(name='ErrorPath', example='error.html'),
  indexPath?: string(name='IndexPath', example='index.html'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model ModifyWebHostingConfigResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='074C8CF9-E7F8-436D-A546-4E5876D0F800'),
}

model ModifyWebHostingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyWebHostingConfigResponseBody(name='body'),
}

async function modifyWebHostingConfigWithOptions(request: ModifyWebHostingConfigRequest, runtime: Util.RuntimeOptions): ModifyWebHostingConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.allowedIps)) {
    body['AllowedIps'] = request.allowedIps;
  }
  if (!Util.isUnset(request.errorHttpStatus)) {
    body['ErrorHttpStatus'] = request.errorHttpStatus;
  }
  if (!Util.isUnset(request.errorPath)) {
    body['ErrorPath'] = request.errorPath;
  }
  if (!Util.isUnset(request.indexPath)) {
    body['IndexPath'] = request.indexPath;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyWebHostingConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyWebHostingConfig(request: ModifyWebHostingConfigRequest): ModifyWebHostingConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyWebHostingConfigWithOptions(request, runtime);
}

model OpenServiceRequest {
  serviceName?: string(name='ServiceName', example='CLOUD_FUNCTION'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-4a52-b4ff-xxxxx'),
}

model OpenServiceResponseBody = {
  requestId?: string(name='RequestId', example='E63E7F4F-8538-5B0E-8712-78F92B6DCB9C'),
}

model OpenServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenServiceResponseBody(name='body'),
}

async function openServiceWithOptions(request: OpenServiceRequest, runtime: Util.RuntimeOptions): OpenServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.serviceName)) {
    body['ServiceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OpenService',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function openService(request: OpenServiceRequest): OpenServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openServiceWithOptions(request, runtime);
}

model OpenWebHostingServiceRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model OpenWebHostingServiceResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='1819B1E4-3540-47ED-8E5A-A252C926D81D'),
}

model OpenWebHostingServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenWebHostingServiceResponseBody(name='body'),
}

async function openWebHostingServiceWithOptions(request: OpenWebHostingServiceRequest, runtime: Util.RuntimeOptions): OpenWebHostingServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OpenWebHostingService',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function openWebHostingService(request: OpenWebHostingServiceRequest): OpenWebHostingServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openWebHostingServiceWithOptions(request, runtime);
}

model QueryDBBackupCollectionsRequest {
  backupId?: string(name='BackupId', example='20201118114602_6bd7c996-f620-4026-ae24-418eddf78671'),
  spaceId?: string(name='SpaceId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model QueryDBBackupCollectionsResponseBody = {
  collections?: [ string ](name='Collections'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model QueryDBBackupCollectionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDBBackupCollectionsResponseBody(name='body'),
}

async function queryDBBackupCollectionsWithOptions(request: QueryDBBackupCollectionsRequest, runtime: Util.RuntimeOptions): QueryDBBackupCollectionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.backupId)) {
    body['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDBBackupCollections',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDBBackupCollections(request: QueryDBBackupCollectionsRequest): QueryDBBackupCollectionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDBBackupCollectionsWithOptions(request, runtime);
}

model QueryDBBackupDumpTimesRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model QueryDBBackupDumpTimesResponseBody = {
  backupDumpTimes?: [ 
    {
      backupId?: string(name='BackupId', example='20201118114602_6bd7c996-f620-4026-ae24-418eddf78671'),
      dumpTime?: string(name='DumpTime', example='2020-11-18T03:46:02Z'),
    }
  ](name='BackupDumpTimes'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model QueryDBBackupDumpTimesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDBBackupDumpTimesResponseBody(name='body'),
}

async function queryDBBackupDumpTimesWithOptions(request: QueryDBBackupDumpTimesRequest, runtime: Util.RuntimeOptions): QueryDBBackupDumpTimesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDBBackupDumpTimes',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDBBackupDumpTimes(request: QueryDBBackupDumpTimesRequest): QueryDBBackupDumpTimesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDBBackupDumpTimesWithOptions(request, runtime);
}

model QueryDBExportTaskStatusRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9*****'),
  taskId?: string(name='TaskId', example='0150006d-ab93-4920-a63e-c011dea*****'),
}

model QueryDBExportTaskStatusResponseBody = {
  detailMessage?: string(name='DetailMessage', example='SERVER_BUSY'),
  downloadUrl?: string(name='DownloadUrl', example='https://mps-zjk-share.oss-cn-zhangjiakou.aliyuncs.com/mongo/export/0e16bb12-14af-4635-b24c-5ac1a9a7bb9f/20200720104406_0150006d-ab93-4920-a63e-c011dea1e089.csv?Expires=1595215206&OSSAccessKeyId=LTAIupaslTlU****&Signature=CKxpKX3Wj%2BLVtZ****%2FTbe%2BX9sc%3D'),
  exportedCount?: string(name='ExportedCount', example='2'),
  requestId?: string(name='RequestId', example='58881468-E779-4203-B933-BD53FDC60D6F'),
  status?: string(name='Status', example='SUCCESS'),
}

model QueryDBExportTaskStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDBExportTaskStatusResponseBody(name='body'),
}

async function queryDBExportTaskStatusWithOptions(request: QueryDBExportTaskStatusRequest, runtime: Util.RuntimeOptions): QueryDBExportTaskStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDBExportTaskStatus',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDBExportTaskStatus(request: QueryDBExportTaskStatusRequest): QueryDBExportTaskStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDBExportTaskStatusWithOptions(request, runtime);
}

model QueryDBImportTaskStatusRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
  taskId?: string(name='TaskId', example='973820af-966d-42ec-9fab-17dfe4a*****'),
}

model QueryDBImportTaskStatusResponseBody = {
  detailMessage?: string(name='DetailMessage', example='SERVER_BUSY'),
  failedCount?: string(name='FailedCount', example='0'),
  requestId?: string(name='RequestId', example='692DCFEF-46DD-4EBB-B1DB-338E687DC260'),
  status?: string(name='Status', example='SUCCESS'),
  successCount?: string(name='SuccessCount', example='6'),
}

model QueryDBImportTaskStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDBImportTaskStatusResponseBody(name='body'),
}

async function queryDBImportTaskStatusWithOptions(request: QueryDBImportTaskStatusRequest, runtime: Util.RuntimeOptions): QueryDBImportTaskStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDBImportTaskStatus',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDBImportTaskStatus(request: QueryDBImportTaskStatusRequest): QueryDBImportTaskStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDBImportTaskStatusWithOptions(request, runtime);
}

model QueryDBRestoreTaskStatusRequest {
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
  taskId?: string(name='TaskId', example='0150006d-ab93-4920-a63e-c011dea1e089'),
}

model QueryDBRestoreTaskStatusResponseBody = {
  detailMessage?: string(name='DetailMessage', example='SERVER_BUSY'),
  failedCount?: long(name='FailedCount', example='1'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  status?: string(name='Status', example='SUCCESS'),
  successCount?: long(name='SuccessCount', example='1'),
}

model QueryDBRestoreTaskStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDBRestoreTaskStatusResponseBody(name='body'),
}

async function queryDBRestoreTaskStatusWithOptions(request: QueryDBRestoreTaskStatusRequest, runtime: Util.RuntimeOptions): QueryDBRestoreTaskStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDBRestoreTaskStatus',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDBRestoreTaskStatus(request: QueryDBRestoreTaskStatusRequest): QueryDBRestoreTaskStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDBRestoreTaskStatusWithOptions(request, runtime);
}

model QueryServiceStatusRequest {
  serviceName?: string(name='ServiceName', example='CLOUD_FUNCTION'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-4a52-b4ff-xxxxx'),
}

model QueryServiceStatusResponseBody = {
  requestId?: string(name='RequestId', example='E63E7F4F-8538-5B0E-8712-78F92B6DCB9C'),
  serviceStatus?: string(name='ServiceStatus', example='OPENING'),
}

model QueryServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryServiceStatusResponseBody(name='body'),
}

async function queryServiceStatusWithOptions(request: QueryServiceStatusRequest, runtime: Util.RuntimeOptions): QueryServiceStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.serviceName)) {
    body['ServiceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryServiceStatus',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryServiceStatus(request: QueryServiceStatusRequest): QueryServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryServiceStatusWithOptions(request, runtime);
}

model QuerySpaceConsumptionRequest {
  spaceId?: string(name='SpaceId', example='mp-95865273-9b1f-496d-****-cb88fa4d66a2'),
}

model QuerySpaceConsumptionResponseBody = {
  csUsage?: {
    cdnTraffic?: long(name='CdnTraffic', example='0'),
    downloadCount?: long(name='DownloadCount', example='0'),
    storageSize?: long(name='StorageSize', example='0'),
    uploadCount?: long(name='UploadCount', example='0'),
  }(name='CsUsage'),
  cycleEndTime?: long(name='CycleEndTime', example='1667059200'),
  cycleStartTime?: long(name='CycleStartTime', example='1664467200'),
  dbUsage?: {
    readCount?: long(name='ReadCount', example='0'),
    storageSize?: long(name='StorageSize', example='0'),
    writeCount?: long(name='WriteCount', example='0'),
  }(name='DbUsage'),
  fcUsage?: {
    cost?: long(name='Cost', example='0'),
    requestCount?: long(name='RequestCount', example='0'),
    txTraffic?: long(name='TxTraffic', example='0'),
  }(name='FcUsage'),
  gmtCreate?: string(name='GmtCreate', example='0'),
  requestId?: string(name='RequestId', example='F16FEFE8-4E57-5795-BE7B-2D29F0C61B8C'),
  spaceId?: string(name='SpaceId', example='mp-26fe89b6-****-4a90-b332-b424ce9651e6'),
  specCode?: string(name='SpecCode', example='BASE'),
  whUsage?: {
    cdnTraffic?: long(name='CdnTraffic', example='0'),
    storageSize?: long(name='StorageSize', example='0'),
  }(name='WhUsage'),
}

model QuerySpaceConsumptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySpaceConsumptionResponseBody(name='body'),
}

async function querySpaceConsumptionWithOptions(request: QuerySpaceConsumptionRequest, runtime: Util.RuntimeOptions): QuerySpaceConsumptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QuerySpaceConsumption',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function querySpaceConsumption(request: QuerySpaceConsumptionRequest): QuerySpaceConsumptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySpaceConsumptionWithOptions(request, runtime);
}

model QuerySpaceSpecDetailRequest {
  specCode?: string(name='SpecCode', example='BASE'),
}

model QuerySpaceSpecDetailResponseBody = {
  csCdnTraffic?: long(name='CsCdnTraffic', example='2147483648'),
  csDownloadCount?: long(name='CsDownloadCount', example='100000'),
  csStorageSize?: long(name='CsStorageSize', example='8589934592'),
  csUploadCount?: long(name='CsUploadCount', example='50000'),
  dbReadCount?: long(name='DbReadCount', example='50000'),
  dbStorageSize?: long(name='DbStorageSize', example='2147483648'),
  dbWriteCount?: long(name='DbWriteCount', example='30000'),
  fcCost?: long(name='FcCost', example='102400000'),
  fcRequestCount?: long(name='FcRequestCount', example='150000'),
  fcTxTraffic?: long(name='FcTxTraffic', example='1073741824'),
  gmtCreate?: string(name='GmtCreate'),
  requestId?: string(name='RequestId', example='20C1EDFE-6355-4344-B20A-A7A5A1581026'),
  specCode?: string(name='SpecCode', example='BASE'),
  specDetailText?: string(name='SpecDetailText'),
  whCdnTraffic?: long(name='WhCdnTraffic', example='2147483648'),
  whStorageSize?: long(name='WhStorageSize', example='8589934592'),
}

model QuerySpaceSpecDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySpaceSpecDetailResponseBody(name='body'),
}

async function querySpaceSpecDetailWithOptions(request: QuerySpaceSpecDetailRequest, runtime: Util.RuntimeOptions): QuerySpaceSpecDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.specCode)) {
    body['SpecCode'] = request.specCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QuerySpaceSpecDetail',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function querySpaceSpecDetail(request: QuerySpaceSpecDetailRequest): QuerySpaceSpecDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySpaceSpecDetailWithOptions(request, runtime);
}

model QuerySpaceUsageRequest {
  endTime?: string(name='EndTime', example='2022-06-18T16:00:00Z'),
  interval?: int32(name='Interval'),
  spaceId?: string(name='SpaceId', example='mp-fd37e37e-b436-4a7a-****-58c89ce3586d'),
  startTime?: string(name='StartTime', example='2022-06-17T16:00:00Z'),
}

model QuerySpaceUsageResponseBody = {
  endTime?: string(name='EndTime', example='2022-06-18T16:00:00Z'),
  requestId?: string(name='RequestId'),
  spaceId?: string(name='SpaceId', example='mp-23c7c857-****-4512-bab0-3dbf986e7576'),
  spaceUsageDataList?: [ 
    {
      csUsage?: {
        cdnTraffic?: long(name='CdnTraffic', example='94134230'),
        downloadCount?: long(name='DownloadCount', example='45668113'),
        storageSize?: long(name='StorageSize', example='4024575081'),
        uploadCount?: long(name='UploadCount', example='2352'),
      }(name='CsUsage'),
      dbUsage?: {
        readCount?: long(name='ReadCount', example='5685123'),
        storageSize?: long(name='StorageSize', example='2542108'),
        writeCount?: long(name='WriteCount', example='241500'),
      }(name='DbUsage'),
      effectiveBillFlag?: boolean(name='EffectiveBillFlag', description='标记该数据是否出账。
- true：正常出账。
- false：不出账，例如在空间停服的情况下，用量数据不用于出账。', example='true'),
      fcUsage?: {
        cost?: long(name='Cost', example='35645000'),
        requestCount?: long(name='RequestCount', example='12451'),
        txTraffic?: long(name='TxTraffic', example='124521635'),
      }(name='FcUsage'),
      timestamp?: string(name='Timestamp', example='2022-06-17T16:00:00Z'),
      whUsage?: {
        cdnTraffic?: long(name='CdnTraffic', example='5644311'),
        storageSize?: long(name='StorageSize', example='226230160'),
      }(name='WhUsage'),
    }
  ](name='SpaceUsageDataList'),
  startTime?: string(name='StartTime', example='2022-06-17T16:00:00Z'),
}

model QuerySpaceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySpaceUsageResponseBody(name='body'),
}

async function querySpaceUsageWithOptions(request: QuerySpaceUsageRequest, runtime: Util.RuntimeOptions): QuerySpaceUsageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    body['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QuerySpaceUsage',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function querySpaceUsage(request: QuerySpaceUsageRequest): QuerySpaceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySpaceUsageWithOptions(request, runtime);
}

model RefreshWebHostingCustomDomainCacheRequest {
  domainName?: string(name='DomainName', example='www.example.com'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a7bb9f'),
}

model RefreshWebHostingCustomDomainCacheResponseBody = {
  requestId?: string(name='RequestId', example='E63E7F4F-8538-5B0E-8712-78F92B6DCB9C'),
}

model RefreshWebHostingCustomDomainCacheResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshWebHostingCustomDomainCacheResponseBody(name='body'),
}

async function refreshWebHostingCustomDomainCacheWithOptions(request: RefreshWebHostingCustomDomainCacheRequest, runtime: Util.RuntimeOptions): RefreshWebHostingCustomDomainCacheResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RefreshWebHostingCustomDomainCache',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refreshWebHostingCustomDomainCache(request: RefreshWebHostingCustomDomainCacheRequest): RefreshWebHostingCustomDomainCacheResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshWebHostingCustomDomainCacheWithOptions(request, runtime);
}

model RegisterFileRequest {
  id?: string(name='Id', example='2fada31e-8fa5-****-b595-9698cd6b5f06'),
  spaceId?: string(name='SpaceId', example='0e16bb12-****-4635-b24c-5ac1a9a7bb9f'),
}

model RegisterFileResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model RegisterFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RegisterFileResponseBody(name='body'),
}

async function registerFileWithOptions(request: RegisterFileRequest, runtime: Util.RuntimeOptions): RegisterFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RegisterFile',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function registerFile(request: RegisterFileRequest): RegisterFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return registerFileWithOptions(request, runtime);
}

model RenameDBCollectionRequest {
  newCollection?: string(name='NewCollection', example='newColl1'),
  originCollection?: string(name='OriginCollection', example='coll1'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9*****'),
}

model RenameDBCollectionResponseBody = {
  requestId?: string(name='RequestId', example='20C1EDFE-6355-4344-B20A-A7A5A1581026'),
}

model RenameDBCollectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenameDBCollectionResponseBody(name='body'),
}

async function renameDBCollectionWithOptions(request: RenameDBCollectionRequest, runtime: Util.RuntimeOptions): RenameDBCollectionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.newCollection)) {
    body['NewCollection'] = request.newCollection;
  }
  if (!Util.isUnset(request.originCollection)) {
    body['OriginCollection'] = request.originCollection;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RenameDBCollection',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function renameDBCollection(request: RenameDBCollectionRequest): RenameDBCollectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return renameDBCollectionWithOptions(request, runtime);
}

model ResetServerSecretRequest {
  spaceId?: string(name='SpaceId', example='826061c4-5095-4550-8b74-3bcd9af*****'),
}

model ResetServerSecretResponseBody = {
  requestId?: string(name='RequestId', example='EA770971-A4A0-4555-9E00-C94A2194E150'),
}

model ResetServerSecretResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetServerSecretResponseBody(name='body'),
}

async function resetServerSecretWithOptions(request: ResetServerSecretRequest, runtime: Util.RuntimeOptions): ResetServerSecretResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResetServerSecret',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetServerSecret(request: ResetServerSecretRequest): ResetServerSecretResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetServerSecretWithOptions(request, runtime);
}

model RunDBCommandRequest {
  body?: string(name='Body', example='{"command":"findOne","collection":"test_collection","query":{"name":"tome"}}'),
  spaceId?: string(name='SpaceId', example='ach41172-adba-4af1-b2e5-63fc5f56a649'),
}

model RunDBCommandResponseBody = {
  affectedDocs?: int32(name='AffectedDocs', example='1'),
  requestId?: string(name='RequestId', example='F75E60FA-7583-4E2E-AC14-6C608F89804'),
  result?: string(name='Result', example='{"_id":"5d107e5af957c439d505b95b","age":1,"name":"aaaaa","time":1561362071732}'),
}

model RunDBCommandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDBCommandResponseBody(name='body'),
}

async function runDBCommandWithOptions(request: RunDBCommandRequest, runtime: Util.RuntimeOptions): RunDBCommandResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.body)) {
    body['Body'] = request.body;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunDBCommand',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function runDBCommand(request: RunDBCommandRequest): RunDBCommandResponse {
  var runtime = new Util.RuntimeOptions{};
  return runDBCommandWithOptions(request, runtime);
}

model RunFunctionRequest {
  body?: string(name='Body', example='{"functionTarget":"test-function","functionArgs":{"a":"aaaa","b":"bbbb","num":100}}'),
  spaceId?: string(name='SpaceId', example='ach41172-adba-4af1-b2e5-63fc5f56a649'),
}

model RunFunctionResponseBody = {
  requestId?: string(name='RequestId', example='F75E60FA-7583-4E2E-AC14-6C608F89804'),
  result?: string(name='Result', example='{"name":"tom"}'),
  runtimeMeta?: {
    billingDuration?: int32(name='BillingDuration', example='600'),
    invocationDuration?: int32(name='InvocationDuration', example='523'),
    maxMemoryUsage?: int32(name='MaxMemoryUsage', example='27'),
    requestId?: string(name='RequestId', example='980879201561364765437209427735'),
  }(name='RuntimeMeta'),
}

model RunFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunFunctionResponseBody(name='body'),
}

async function runFunctionWithOptions(request: RunFunctionRequest, runtime: Util.RuntimeOptions): RunFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.body)) {
    body['Body'] = request.body;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function runFunction(request: RunFunctionRequest): RunFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return runFunctionWithOptions(request, runtime);
}

model SaveAntOpenPlatformConfigRequest {
  appCert?: string(name='AppCert', example='-----BEGIN CERTIFICATE----- MIIEwTCCA6mgAwIBAgIQICAJGbUNoqdPr25qpPU7+ -----END CERTIFICATE-----'),
  appId?: string(name='AppId', example='201909116717****'),
  privateKey?: string(name='PrivateKey', example='MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSk'),
  publicCert?: string(name='PublicCert', example='-----BEGIN CERTIFICATE----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQ -----END CERTIFICATE-----'),
  publicKey?: string(name='PublicKey', example='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCA'),
  rootCert?: string(name='RootCert', example='-----BEGIN CERTIFICATE----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQ -----END CERTIFICATE-----'),
  signMode?: string(name='SignMode', example='CERT'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model SaveAntOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='2540E86F-2CD4-44AC-A7AB-59CAF40C225D'),
}

model SaveAntOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveAntOpenPlatformConfigResponseBody(name='body'),
}

async function saveAntOpenPlatformConfigWithOptions(request: SaveAntOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): SaveAntOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appCert)) {
    body['AppCert'] = request.appCert;
  }
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.privateKey)) {
    body['PrivateKey'] = request.privateKey;
  }
  if (!Util.isUnset(request.publicCert)) {
    body['PublicCert'] = request.publicCert;
  }
  if (!Util.isUnset(request.publicKey)) {
    body['PublicKey'] = request.publicKey;
  }
  if (!Util.isUnset(request.rootCert)) {
    body['RootCert'] = request.rootCert;
  }
  if (!Util.isUnset(request.signMode)) {
    body['SignMode'] = request.signMode;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveAntOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveAntOpenPlatformConfig(request: SaveAntOpenPlatformConfigRequest): SaveAntOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveAntOpenPlatformConfigWithOptions(request, runtime);
}

model SaveAppAuthTokenRequest {
  appAuthToken?: string(name='AppAuthToken', example='202111BB576ef688a3564875a75a9babd6XXXXXX'),
  appId?: string(name='AppId', example='2021002198669xxx'),
  isvAppId?: string(name='IsvAppId', example='2021002110693xxx'),
  spaceId?: string(name='SpaceId', example='368ef42a-763f-0000-acc2-8aa9564c****'),
}

model SaveAppAuthTokenResponseBody = {
  requestId?: string(name='RequestId', example='F340DF8D-7125-49B7-AC48-7F5C8DB382CB'),
}

model SaveAppAuthTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveAppAuthTokenResponseBody(name='body'),
}

async function saveAppAuthTokenWithOptions(request: SaveAppAuthTokenRequest, runtime: Util.RuntimeOptions): SaveAppAuthTokenResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appAuthToken)) {
    body['AppAuthToken'] = request.appAuthToken;
  }
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.isvAppId)) {
    body['IsvAppId'] = request.isvAppId;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveAppAuthToken',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveAppAuthToken(request: SaveAppAuthTokenRequest): SaveAppAuthTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveAppAuthTokenWithOptions(request, runtime);
}

model SaveCdnDomainConfigRequest {
  authConfig?: string(name='AuthConfig', example='{"authType":"type_a", "authKey":"hkpyytgrnf", "authDelta":1800}'),
  corsConfig?: string(name='CorsConfig', example='{"allowOrigin":"https://*.example.com", "accessOriginControl": true}'),
  ipConfig?: string(name='IpConfig', example='{"type":"white", "ipList":"192.168.2.0/24"}'),
  refererConfig?: string(name='RefererConfig', example='{"type":"white", "referList":"example.com", "allowEmpty":"off", "disableAst":"off"}'),
  spaceId?: string(name='SpaceId', example='mp-03c11beb-****-4d02-bb40-65a7ad224f4d'),
  tenantId?: string(name='TenantId', example='UNIULEH***'),
  type?: string(name='Type', example='FILE'),
  uaConfig?: string(name='UaConfig', example='{"type":"white", "uaList":"*IE*|*firefox*"}'),
}

model SaveCdnDomainConfigResponseBody = {
  requestId?: string(name='RequestId', example='9B1D280D-F8C8-****-B30F-BDE5A981FDA9'),
}

model SaveCdnDomainConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveCdnDomainConfigResponseBody(name='body'),
}

async function saveCdnDomainConfigWithOptions(request: SaveCdnDomainConfigRequest, runtime: Util.RuntimeOptions): SaveCdnDomainConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authConfig)) {
    body['AuthConfig'] = request.authConfig;
  }
  if (!Util.isUnset(request.corsConfig)) {
    body['CorsConfig'] = request.corsConfig;
  }
  if (!Util.isUnset(request.ipConfig)) {
    body['IpConfig'] = request.ipConfig;
  }
  if (!Util.isUnset(request.refererConfig)) {
    body['RefererConfig'] = request.refererConfig;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.uaConfig)) {
    body['UaConfig'] = request.uaConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveCdnDomainConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveCdnDomainConfig(request: SaveCdnDomainConfigRequest): SaveCdnDomainConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveCdnDomainConfigWithOptions(request, runtime);
}

model SaveWebHostingCustomDomainConfigRequest {
  domainName?: string(name='DomainName', example='www.example.com'),
  forceRedirectType?: string(name='ForceRedirectType', example='HTTPS_FORCE'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model SaveWebHostingCustomDomainConfigResponseBody = {
  requestId?: string(name='RequestId', example='828A8808-3FC9-418C-893A-5A708CFABB8E'),
}

model SaveWebHostingCustomDomainConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveWebHostingCustomDomainConfigResponseBody(name='body'),
}

async function saveWebHostingCustomDomainConfigWithOptions(request: SaveWebHostingCustomDomainConfigRequest, runtime: Util.RuntimeOptions): SaveWebHostingCustomDomainConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.forceRedirectType)) {
    body['ForceRedirectType'] = request.forceRedirectType;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveWebHostingCustomDomainConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveWebHostingCustomDomainConfig(request: SaveWebHostingCustomDomainConfigRequest): SaveWebHostingCustomDomainConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveWebHostingCustomDomainConfigWithOptions(request, runtime);
}

model SaveWebHostingCustomDomainCorsConfigRequest {
  accessControlAllowOrigin?: string(name='AccessControlAllowOrigin', example='https://*.example.com, https://*.example.org'),
  accessOriginControl?: boolean(name='AccessOriginControl'),
  domainName?: string(name='DomainName', example='www.example.com'),
  enableCors?: boolean(name='EnableCors', example='true'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-4a52-b4ff-35a09f8*****'),
}

model SaveWebHostingCustomDomainCorsConfigResponseBody = {
  code?: string(name='Code', example='success'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='SpaceNotExist'),
  requestId?: string(name='RequestId', example='6E2E1770-E9C7-52E9-BF2C-94A0BACFADBE"'),
  success?: boolean(name='Success', example='true'),
}

model SaveWebHostingCustomDomainCorsConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveWebHostingCustomDomainCorsConfigResponseBody(name='body'),
}

async function saveWebHostingCustomDomainCorsConfigWithOptions(request: SaveWebHostingCustomDomainCorsConfigRequest, runtime: Util.RuntimeOptions): SaveWebHostingCustomDomainCorsConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessControlAllowOrigin)) {
    body['AccessControlAllowOrigin'] = request.accessControlAllowOrigin;
  }
  if (!Util.isUnset(request.accessOriginControl)) {
    body['AccessOriginControl'] = request.accessOriginControl;
  }
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.enableCors)) {
    body['EnableCors'] = request.enableCors;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveWebHostingCustomDomainCorsConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveWebHostingCustomDomainCorsConfig(request: SaveWebHostingCustomDomainCorsConfigRequest): SaveWebHostingCustomDomainCorsConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveWebHostingCustomDomainCorsConfigWithOptions(request, runtime);
}

model SaveWechatOpenPlatformConfigRequest {
  appId?: string(name='AppId', example='123456'),
  appSecret?: string(name='AppSecret', example='9w0BAQEFAASCBKgwggSkAgEAAoI'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model SaveWechatOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='44DF7A95-603F-4651-9298-BE1850BEB53F'),
}

model SaveWechatOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveWechatOpenPlatformConfigResponseBody(name='body'),
}

async function saveWechatOpenPlatformConfigWithOptions(request: SaveWechatOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): SaveWechatOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appSecret)) {
    body['AppSecret'] = request.appSecret;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveWechatOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveWechatOpenPlatformConfig(request: SaveWechatOpenPlatformConfigRequest): SaveWechatOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveWechatOpenPlatformConfigWithOptions(request, runtime);
}

model UnbindWebHostingCustomDomainRequest {
  customDomain?: string(name='CustomDomain', example='www.example.com'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-4635-b24c-5ac1a9a*****'),
}

model UnbindWebHostingCustomDomainResponseBody = {
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='CEF9831B-A6D2-4485-9CAD-1B8FBC8BC6F7'),
}

model UnbindWebHostingCustomDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindWebHostingCustomDomainResponseBody(name='body'),
}

async function unbindWebHostingCustomDomainWithOptions(request: UnbindWebHostingCustomDomainRequest, runtime: Util.RuntimeOptions): UnbindWebHostingCustomDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.customDomain)) {
    body['CustomDomain'] = request.customDomain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UnbindWebHostingCustomDomain',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindWebHostingCustomDomain(request: UnbindWebHostingCustomDomainRequest): UnbindWebHostingCustomDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindWebHostingCustomDomainWithOptions(request, runtime);
}

model UpdateDingtalkOpenPlatformConfigRequest {
  appId?: string(name='AppId', example='dingoa7pqicyk3x9t*****'),
  appSecret?: string(name='AppSecret', example='1r0ElNPFqLI6qgY08*******************************9TIK3RN_5fk9SEMO'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model UpdateDingtalkOpenPlatformConfigResponseBody = {
  requestId?: string(name='RequestId', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model UpdateDingtalkOpenPlatformConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDingtalkOpenPlatformConfigResponseBody(name='body'),
}

async function updateDingtalkOpenPlatformConfigWithOptions(request: UpdateDingtalkOpenPlatformConfigRequest, runtime: Util.RuntimeOptions): UpdateDingtalkOpenPlatformConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appSecret)) {
    body['AppSecret'] = request.appSecret;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDingtalkOpenPlatformConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDingtalkOpenPlatformConfig(request: UpdateDingtalkOpenPlatformConfigRequest): UpdateDingtalkOpenPlatformConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDingtalkOpenPlatformConfigWithOptions(request, runtime);
}

model UpdateFunctionRequest {
  desc?: string(name='Desc', example='description'),
  httpTriggerPath?: string(name='HttpTriggerPath', example='/http/hello'),
  instanceConcurrency?: int32(name='InstanceConcurrency', example='1'),
  memory?: int32(name='Memory', example='256'),
  name?: string(name='Name', example='demoFunction'),
  runtime?: string(name='Runtime', example='nodejs8'),
  spaceId?: string(name='SpaceId', example='dece4ea0-d432-4cfa-8514-8a88d205e2b8'),
  timeout?: int32(name='Timeout', example='5'),
  timingTriggerConfig?: string(name='TimingTriggerConfig', example='cron:0 0 * * * *'),
  timingTriggerUserPayload?: string(name='TimingTriggerUserPayload', example='hello'),
}

model UpdateFunctionResponseBody = {
  createdAt?: string(name='CreatedAt'),
  desc?: string(name='Desc', example='description'),
  httpTriggerPath?: string(name='HttpTriggerPath', example='/http/hello'),
  modifiedAt?: string(name='ModifiedAt'),
  name?: string(name='Name', example='demoFunction'),
  requestId?: string(name='RequestId', example='C293BB03-B6AD-46C2-80D1-19C8FB573916'),
  spec?: {
    instanceConcurrency?: int32(name='InstanceConcurrency', example='1'),
    memory?: string(name='Memory', example='128 MB'),
    runtime?: string(name='Runtime', example='Node.js 8'),
    timeout?: string(name='Timeout', example='5s'),
  }(name='Spec'),
  timingTriggerConfig?: string(name='TimingTriggerConfig', example='cron:0 0 * * * *'),
  timingTriggerUserPayload?: string(name='TimingTriggerUserPayload', example='24'),
}

model UpdateFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFunctionResponseBody(name='body'),
}

async function updateFunctionWithOptions(request: UpdateFunctionRequest, runtime: Util.RuntimeOptions): UpdateFunctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.httpTriggerPath)) {
    body['HttpTriggerPath'] = request.httpTriggerPath;
  }
  if (!Util.isUnset(request.instanceConcurrency)) {
    body['InstanceConcurrency'] = request.instanceConcurrency;
  }
  if (!Util.isUnset(request.memory)) {
    body['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.runtime)) {
    body['Runtime'] = request.runtime;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.timeout)) {
    body['Timeout'] = request.timeout;
  }
  if (!Util.isUnset(request.timingTriggerConfig)) {
    body['TimingTriggerConfig'] = request.timingTriggerConfig;
  }
  if (!Util.isUnset(request.timingTriggerUserPayload)) {
    body['TimingTriggerUserPayload'] = request.timingTriggerUserPayload;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFunction',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFunction(request: UpdateFunctionRequest): UpdateFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateFunctionWithOptions(request, runtime);
}

model UpdateHttpTriggerConfigRequest {
  customDomain?: string(name='CustomDomain', example='abc.xxx.com'),
  customDomainCertificate?: string(name='CustomDomainCertificate', example='-----BEGIN CERTIFICATE----- MIIFK****GCSqGSIb3DQEBCwUA= -----END CERTIFICATE-----'),
  customDomainPrivateKey?: string(name='CustomDomainPrivateKey', example='-----BEGIN PRIVATE KEY----- MIIEwA******DmUwVD0M74ECwZw= -----END PRIVATE KEY-----'),
  enableService?: boolean(name='EnableService', example='true'),
  spaceId?: string(name='SpaceId', example='34C45988-2B24-****-A4DC-4D6C952890D8'),
}

model UpdateHttpTriggerConfigResponseBody = {
  customDomain?: string(name='CustomDomain', example='abc.example.com'),
  customDomainCertificateInfo?: string(name='CustomDomainCertificateInfo', example='{"notAfter":"2021-09-28T08:21:42Z","notBefore":"2021-06-30T08:21:43Z","subject":"CN=*.example.com"}'),
  customDomainCname?: string(name='CustomDomainCname', example='724d************795a2.custom.bspapp.com'),
  defaultEndpoint?: string(name='DefaultEndpoint', example='724dade5-492f-426b-a5df-ff****0795a2.bspapp.com'),
  enableService?: boolean(name='EnableService', example='true'),
  requestId?: string(name='RequestId', example='34C45988-2B24-****-A4DC-4D6C952890D8'),
}

model UpdateHttpTriggerConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHttpTriggerConfigResponseBody(name='body'),
}

async function updateHttpTriggerConfigWithOptions(request: UpdateHttpTriggerConfigRequest, runtime: Util.RuntimeOptions): UpdateHttpTriggerConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.customDomain)) {
    body['CustomDomain'] = request.customDomain;
  }
  if (!Util.isUnset(request.customDomainCertificate)) {
    body['CustomDomainCertificate'] = request.customDomainCertificate;
  }
  if (!Util.isUnset(request.customDomainPrivateKey)) {
    body['CustomDomainPrivateKey'] = request.customDomainPrivateKey;
  }
  if (!Util.isUnset(request.enableService)) {
    body['EnableService'] = request.enableService;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHttpTriggerConfig',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateHttpTriggerConfig(request: UpdateHttpTriggerConfigRequest): UpdateHttpTriggerConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateHttpTriggerConfigWithOptions(request, runtime);
}

model UpdateServicePolicyRequest {
  collectionName?: string(name='CollectionName', example='test'),
  policy?: string(name='Policy', example='{\\".write\\":false,\\".read\\":true}'),
  policyName?: string(name='PolicyName', example='EXTENDED'),
  serviceName?: string(name='ServiceName', example='db'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model UpdateServicePolicyResponseBody = {
  collectionName?: string(name='CollectionName', example='test'),
  policy?: string(name='Policy', example='{\\".write\\":false,\\".read\\":true}'),
  policyName?: string(name='PolicyName', example='EXTENDED'),
  requestId?: string(name='RequestId', example='8932780D-9AF2-4E50-844C-13A1250918EE'),
  serviceName?: string(name='ServiceName', example='db'),
  spaceId?: string(name='SpaceId', example='0e16bb12-14af-****-b24c-5ac1a9a7bb9f'),
}

model UpdateServicePolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServicePolicyResponseBody(name='body'),
}

async function updateServicePolicyWithOptions(request: UpdateServicePolicyRequest, runtime: Util.RuntimeOptions): UpdateServicePolicyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.collectionName)) {
    body['CollectionName'] = request.collectionName;
  }
  if (!Util.isUnset(request.policy)) {
    body['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.policyName)) {
    body['PolicyName'] = request.policyName;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['ServiceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServicePolicy',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateServicePolicy(request: UpdateServicePolicyRequest): UpdateServicePolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateServicePolicyWithOptions(request, runtime);
}

model UpdateSpaceRequest {
  desc?: string(name='Desc'),
  spaceId?: string(name='SpaceId', example='826061c4-5095-4550-8b74-3bcd9af*****'),
  status?: string(name='Status', example='IN_SERVICE'),
}

model UpdateSpaceResponseBody = {
  requestId?: string(name='RequestId', example='EA770971-A4A0-4555-9E00-C94A2194E150'),
}

model UpdateSpaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSpaceResponseBody(name='body'),
}

async function updateSpaceWithOptions(request: UpdateSpaceRequest, runtime: Util.RuntimeOptions): UpdateSpaceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSpace',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSpace(request: UpdateSpaceRequest): UpdateSpaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSpaceWithOptions(request, runtime);
}

model VerifyWebHostingDomainOwnerRequest {
  domain?: string(name='Domain', example='example.com'),
  spaceId?: string(name='SpaceId', example='226e5213-697c-****-b4ff-35a09f8a52de'),
  verifyType?: string(name='VerifyType', example='dnsCheck'),
}

model VerifyWebHostingDomainOwnerResponseBody = {
  requestId?: string(name='RequestId', example='74374923-6536-46EB-8639-409384EAE980'),
}

model VerifyWebHostingDomainOwnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyWebHostingDomainOwnerResponseBody(name='body'),
}

async function verifyWebHostingDomainOwnerWithOptions(request: VerifyWebHostingDomainOwnerRequest, runtime: Util.RuntimeOptions): VerifyWebHostingDomainOwnerResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domain)) {
    body['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.spaceId)) {
    body['SpaceId'] = request.spaceId;
  }
  if (!Util.isUnset(request.verifyType)) {
    body['VerifyType'] = request.verifyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'VerifyWebHostingDomainOwner',
    version = '2019-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyWebHostingDomainOwner(request: VerifyWebHostingDomainOwnerRequest): VerifyWebHostingDomainOwnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyWebHostingDomainOwnerWithOptions(request, runtime);
}

